Skip to content

Commit 61a3018

Browse files
committed
CA-352465: Fix refactoring bug in add_basic_port
The call to Brctl.create_port must always be done for the Bridge case. Signed-off-by: Rob Hoes <[email protected]>
1 parent 1472e5e commit 61a3018

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

networkd/network_server.ml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,12 +1173,12 @@ module Bridge = struct
11731173
no MAC address was specified"
11741174
name bridge
11751175
)
1176-
| Bridge -> (
1177-
match interfaces with
1178-
| [iface] ->
1179-
Interface.bring_up () dbg ~name:iface
1180-
| _ ->
1181-
( Linux_bonding.add_bond_master name ;
1176+
| Bridge ->
1177+
( match interfaces with
1178+
| [iface] ->
1179+
Interface.bring_up () dbg ~name:iface
1180+
| _ ->
1181+
Linux_bonding.add_bond_master name ;
11821182
let bond_properties =
11831183
match List.assoc_opt "mode" bond_properties with
11841184
| Some "lacp" ->
@@ -1196,16 +1196,15 @@ module Bridge = struct
11961196
warn "No MAC address specified for the bond"
11971197
) ;
11981198
Interface.bring_up () dbg ~name
1199-
) ;
1200-
if need_enic_workaround () then (
1201-
debug "Applying enic workaround: adding VLAN0 device to bridge" ;
1202-
Ip.create_vlan name 0 ;
1203-
let vlan0 = Ip.vlan_name name 0 in
1204-
Interface.bring_up () dbg ~name:vlan0 ;
1205-
ignore (Brctl.create_port bridge vlan0)
1206-
) else
1207-
ignore (Brctl.create_port bridge name)
1208-
)
1199+
) ;
1200+
if need_enic_workaround () then (
1201+
debug "Applying enic workaround: adding VLAN0 device to bridge" ;
1202+
Ip.create_vlan name 0 ;
1203+
let vlan0 = Ip.vlan_name name 0 in
1204+
Interface.bring_up () dbg ~name:vlan0 ;
1205+
ignore (Brctl.create_port bridge vlan0)
1206+
) else
1207+
ignore (Brctl.create_port bridge name)
12091208

12101209
let add_pvs_proxy_port dbg bridge name _port =
12111210
match !backend_kind with

0 commit comments

Comments
 (0)