dhcpcd service: want for both IP stacks

We want to wait for both stacks to be active before declaring that network is active.
So either both default gateways must be specified or only IPv4 if IPv6 is disabled to
avoid dhcpcd for network-online.target.

Changed files
+1 -1
nixos
modules
services
networking
+1 -1
nixos/modules/services/networking/dhcpcd.nix
···
systemd.services.dhcpcd = let
cfgN = config.networking;
hasDefaultGatewaySet = (cfgN.defaultGateway != null && cfgN.defaultGateway.address != "")
-
|| (cfgN.defaultGateway6 != null && cfgN.defaultGateway6.address != "");
in
{ description = "DHCP Client";
···
systemd.services.dhcpcd = let
cfgN = config.networking;
hasDefaultGatewaySet = (cfgN.defaultGateway != null && cfgN.defaultGateway.address != "")
+
&& (!cfgN.enableIPv6 || (cfgN.defaultGateway6 != null && cfgN.defaultGateway6.address != ""));
in
{ description = "DHCP Client";