mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-13 05:05:29 +03:00
nixos/network-interfaces-scripted: fix container networking bug
When a bridge interface was reconfigured, running containers using
this bridge lost connectivity: restarting network-addresses-brN.service
triggered a restart of network-setup.service via a "partOf" relationship
introduced in 07e0c0e0a2
.
This in turn restarted brN-netdev.service.
The bridge was thus destroyed and recreated with the same name but a new
interface id, causing attached veth interfaces to lose their connection.
This change removes the "partOf" relationship between
network-setup.service and network-addresses-brN.service for all bridges.
This commit is contained in:
parent
7df10f388d
commit
2742063677
1 changed files with 2 additions and 1 deletions
|
@ -85,7 +85,8 @@ let
|
||||||
after = [ "network-pre.target" "systemd-udevd.service" "systemd-sysctl.service" ];
|
after = [ "network-pre.target" "systemd-udevd.service" "systemd-sysctl.service" ];
|
||||||
before = [ "network.target" "shutdown.target" ];
|
before = [ "network.target" "shutdown.target" ];
|
||||||
wants = [ "network.target" ];
|
wants = [ "network.target" ];
|
||||||
partOf = map (i: "network-addresses-${i.name}.service") interfaces;
|
# exclude bridges from the partOf relationship to fix container networking bug #47210
|
||||||
|
partOf = map (i: "network-addresses-${i.name}.service") (filter (i: !(hasAttr i.name cfg.bridges)) interfaces);
|
||||||
conflicts = [ "shutdown.target" ];
|
conflicts = [ "shutdown.target" ];
|
||||||
wantedBy = [ "multi-user.target" ] ++ optional hasDefaultGatewaySet "network-online.target";
|
wantedBy = [ "multi-user.target" ] ++ optional hasDefaultGatewaySet "network-online.target";
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue