device: add ipv4.link-local=fallback (IPv4LL set iff no other IPv4 set)

When a connection with ipv4.method=auto (DHCP) is configured with
ipv4.link-local=enable we were leaving the link-local address forever,
but this is not correct according to RFC3927[1] which says:
  a host SHOULD NOT have both an operable routable address and an IPv4
  Link-Local address configured on the same interface.

This adds a new mode that is more compliant, which only sets an IPv4
link-local address if no other address is set (through either DHCP lease
or ivp4.addresses setting)

Closes #1562

Link: https://github.com/systemd/systemd/issues/13316
Link: https://datatracker.ietf.org/doc/html/rfc3927#section-1.9 [1]
This commit is contained in:
Dominique Martinet
2024-07-03 16:13:53 +09:00
committed by Beniamino Galvani
parent b3d2902ad4
commit c575293f1b
6 changed files with 71 additions and 20 deletions

2
NEWS
View File

@@ -26,6 +26,8 @@ USE AT YOUR OWN RISK. NOT RECOMMENDED FOR PRODUCTION USE!
* Support reapplying the VLANs on bridge ports.
* Fix crash caused by malformed LLDP package if debug log is enabled
* Retry hostname resolution when it fails
* Add new ipv4.link-local=fallback to set an IPv4 link-local address
when no other IPv4 is set.
=============================================
NetworkManager-1.48