NetworkManager/src/nm-initrd-generator
Íñigo Huguet 6f6bb17a28 nm-initrd-generator: fix ignored prefix for IPv6 address with brackets
When defining an IPv6 address with square brackets and prefix, like
[dead::beef]/64, the prefix was silently ignored. The address was
accepted only accidentally, because get_word replaced ']' with '\0' so
it resulted in a valid IPv6 address string, but without the prefix.

The previous commit has fixed get_word with better logic to handle the
square brackets, uncovering this issue.

Fix it by explicitly splitting IP addresses and prefixes in
reader_parse_ip so we get a valid address and prefix.

Also, use a prefix different to 64 in the test test_if_ip6_manual. 64 is
the default one, making that the test passed despite the defined prefix
was actually ignored.

Fixes: ecc074b2f8 ('initrd: add command line parser')
2025-05-14 07:35:31 +02:00
..
tests nm-initrd-generator: fix ignored prefix for IPv6 address with brackets 2025-05-14 07:35:31 +02:00
meson.build initrd: avoid dynamic linking of libnvme, use dlopen() instead 2025-04-28 16:09:54 +00:00
nm-initrd-generator.c initrd-generator: support rd.net.dns-backend and rd.net.dns-resolve-mode 2025-02-04 10:44:48 +01:00
nm-initrd-generator.h initrd: add new NBFT parser 2025-04-28 16:09:54 +00:00
nmi-cmdline-reader.c nm-initrd-generator: fix ignored prefix for IPv6 address with brackets 2025-05-14 07:35:31 +02:00
nmi-dt-reader.c glib-aux: avoid using inet_aton() 2023-05-08 15:44:49 +02:00
nmi-ibft-reader.c glib-aux: add and use nm_uuid_generate_from_strings_old() 2022-10-11 09:03:17 +02:00
nmi-nbft-reader.c initrd: fix crash in the NBFT parser 2025-04-30 09:24:50 +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