Skip to content

Commit

Permalink
nixos/network-interfaces: ensure slave interfaces are up
Browse files Browse the repository at this point in the history
Fixes #28620.
  • Loading branch information
fpletz committed Sep 25, 2017
1 parent 13a110e commit 263185a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions nixos/modules/tasks/network-interfaces-scripted.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ let
interfaces = attrValues cfg.interfaces;
hasVirtuals = any (i: i.virtual) interfaces;

slaves = concatMap (i: i.interfaces) (attrValues cfg.bonds)
++ concatMap (i: i.interfaces) (attrValues cfg.bridges)
++ concatMap (i: i.interfaces) (attrValues cfg.vswitches)
++ concatMap (i: [i.interface]) (attrValues cfg.macvlans)
++ concatMap (i: [i.interface]) (attrValues cfg.vlans);

# We must escape interfaces due to the systemd interpretation
subsystemDevice = interface:
"sys-subsystem-net-devices-${escapeSystemdPath interface}.device";
Expand Down Expand Up @@ -469,5 +475,8 @@ in
config = mkMerge [
bondWarnings
(mkIf (!cfg.useNetworkd) normalConfig)
{ # Ensure slave interfaces are brought up
networking.interfaces = genAttrs slaves (i: {});
}
];
}

0 comments on commit 263185a

Please sign in to comment.