Skip to content

Commit cb3a00e

Browse files
authored
[SecondaryNetwork] Fix agent crash if host interface is already attached to OVS bridge (antrea-io#6666)
PrepareHostInterfaceConnection should return the bridged interface name if the host interface is already attached to the OVS bridge. Signed-off-by: Xu Liu <xu.liu@broadcom.com>
1 parent 51c5107 commit cb3a00e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/agent/util/net_linux.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -419,12 +419,12 @@ func PrepareHostInterfaceConnection(
419419
// If the port already exists, just return.
420420
if ofPort, err := bridge.GetOFPort(bridgedName, false); err == nil {
421421
klog.InfoS("Port already exists, skip the configuration", "port", bridgedName, "ofPort", ofPort)
422-
return "", true, nil
422+
return bridgedName, true, nil
423423
}
424424

425425
iface, ifaceIPs, ifaceRoutes, err := GetInterfaceConfig(ifaceName)
426426
if err != nil {
427-
return "", false, nil
427+
return "", false, err
428428
}
429429

430430
if err = RenameInterface(ifaceName, bridgedName); err != nil {

0 commit comments

Comments
 (0)