Skip to content

Commit 6aa55ea

Browse files
committed
Merge pull request #28 from robhoes/ea1254
CA-114498: Linux bonding: set properties (e.g. mode) before adding slave...
2 parents c8212d7 + 0248f1b commit 6aa55ea

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

networkd/network_server.ml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -637,18 +637,18 @@ module Bridge = struct
637637
end else begin
638638
if not (List.mem name (Sysfs.bridge_to_interfaces bridge)) then begin
639639
Linux_bonding.add_bond_master name;
640-
List.iter (fun name -> Interface.bring_down () dbg ~name) interfaces;
641-
List.iter (Linux_bonding.add_bond_slave name) interfaces;
642-
begin match bond_mac with
643-
| Some mac -> Ip.set_mac name mac
644-
| None -> warn "No MAC address specified for the bond"
645-
end;
646640
let bond_properties =
647641
if List.mem_assoc "mode" bond_properties && List.assoc "mode" bond_properties = "lacp" then
648642
List.replace_assoc "mode" "802.3ad" bond_properties
649643
else bond_properties
650644
in
651-
Linux_bonding.set_bond_properties name bond_properties
645+
Linux_bonding.set_bond_properties name bond_properties;
646+
List.iter (fun name -> Interface.bring_down () dbg ~name) interfaces;
647+
List.iter (Linux_bonding.add_bond_slave name) interfaces;
648+
begin match bond_mac with
649+
| Some mac -> Ip.set_mac name mac
650+
| None -> warn "No MAC address specified for the bond"
651+
end
652652
end;
653653
Interface.bring_up () dbg ~name;
654654
ignore (Brctl.create_port bridge name)

0 commit comments

Comments
 (0)