NetworkManager/src/nm-initrd-generator
Beniamino Galvani 28770eb394 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] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/729

https://bugzilla.redhat.com/show_bug.cgi?id=1961666
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/994
2021-11-02 11:02:38 +01:00
..
tests initrd: handle ip=dhcp,dhcp6 specially 2021-11-02 11:02:38 +01:00
meson.build build: fix linking libnm-log-null into different test programs 2021-07-05 14:51:27 +02:00
nm-initrd-generator.c initrd: add a 'origin' user tag to connections 2021-07-27 16:36:48 +02:00
nm-initrd-generator.h initrd: set required-timeout for default IPv4 configuration 2021-07-05 15:15:45 +02:00
nmi-cmdline-reader.c initrd: handle ip=dhcp,dhcp6 specially 2021-11-02 11:02:38 +01:00
nmi-dt-reader.c initrd: move "src/core/initrd/" to "src/nm-initrd-generator/" 2021-03-15 17:10:53 +01:00
nmi-ibft-reader.c all: only include "libnm-glib-aux/nm-uuid.h" where needed 2021-05-04 15:51:51 +02:00
README.md all: add some README.md files describing the purpose of our sources 2021-08-19 17:51:11 +02:00

nm-initrd-generator

A command line tool that generates NetworkManager configuration.

This is supposed to be run by dracut in initrd, before NetworkManager starts. It parses the kernel command line, generates configuration and quits.

See:

  • man 8 nm-initrd-generator ([www])
  • man 7 dracut.cmdline