initrd: handle `ip=dhcp,dhcp6` specially
With ip=dhcp,dhcp6
the legacy dracut module does first DHCPv4 and
then IPv6 autoconf (even if DHCPv4 succeeded) [1]. In this way, there
is the guarantee that an address family is always configured if the
network supports it.
Currently ip=dhcp,dhcp6
is treated a bit differently by NM, which
generates a connection with only ipv4.required-timeout=20s. Therefore
it's possible that NM in initrd quits (or signals startup-complete)
without an IPv6 even if the network is configured for IPv6.
Make NM's behavior similar to the legacy module by also setting an
ipv6.required-timeout for ip=dhcp,dhcp6
.
Note that if the command line contains rd.neednet=1
without an ip=
argument, we still generate a default connection with IPv4 preferred
over IPv6 (i.e. only ipv4.required-timeout set). That's similar to
what the legacy module does [2]. See [3] for a description of
different scenarios for "rd.neednet=1".
[1] https://github.com/dracutdevs/dracut/blob/055/modules.d/35network-legacy/ifup.sh#L459-L484
[2] https://github.com/dracutdevs/dracut/blob/055/modules.d/35network-legacy/ifup.sh#L529-L537
[3] #729 (closed)