initrd: unset dhcp options for static profiles
Summary
When the command line only contains static addresses and a hostname, the initrd generator sets properties ipv4/ipv6.dhcp-hostname
and ipv4/ipv6.dhcp-timeout
, which are ignored because the profile is not using DHCP. This MR makes it so that these are unset when they are deemed unnecessary.
Tests have also been updated to account for this change.
Purpose
Fixes #1276 (closed)
Checklist
Please read https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/main/CONTRIBUTING.md before opening the merge request. In particular, check that:
-
the subject for all commits is concise and explicative -
the message for all commits explains the reason for the change -
the source is properly formatted -
any relevant documentation is up to date -
you have added unit tests if applicable