network: fold ipv4ll fallback modes into normal ipv4ll addressing#17692
network: fold ipv4ll fallback modes into normal ipv4ll addressing#17692keszybz merged 10 commits intosystemd:masterfrom
Conversation
6657a89 to
1a4cefe
Compare
|
Yey, now all CentOS CIs are green. |
The code was changed in 715cedf to allow more than six attempts and the old description stopped making sense.
…lues They are not really boolean, because we have both ipv4 and ipv6, but for each protocol we have either unset, no, and yes. From systemd#13316 (comment): LinkLocalAddressing must be a boolean option, at least for ipv4: - LinkLocalAddressing=no => no LL at all. - LinkLocalAddressing=yes + Static Address => invalid configuration, warn and interpret as LinkLocalAddressing=no, no LL at all. (we check that during parsing and reject) - LinkLocalAddressing=yes + DHCP => LL process should be subordinated to the DHCP one, an LL address must be acquired at start or after a short N unsuccessful DHCP attemps, and must not stop DHCP to keeping trying. When a DHCP address is acquired, drop the LL address. If the DHCP address is lost, re-adquire a new LL address. (next patch will move in this direction) - LinkLocalAddressing=fallback has no reason to exist, because LL address must always be allocated as a fallback option when using DHCP. Having both DHCP and LL address at the same time is an RFC violation, so LinkLocalAdressing=yes correctly implemented is already the "fallback" behavior. The fallback option must be deprecated and if present in older configs must be interpreted as LinkLocalAddressing=yes. (removed) - And for IPv6, the LinkLocalAddress option has any sense at all? IPv6-LL address aren't required to be always set for every IPv6 enabled interface (in this case, coexisting with static or dynamic address if any)? Shouldn't be always =yes? (good question) This effectively reverts 29e8108. There is no special "fallback" mode now, so the check doesn't make sense anymore.
So far we only reported major state transitions like failure to acquire the message. Let's report the initial failure after a few timeouts in a new event type. The number of timeouts is hardcoded as 3, since Windows seems to be using that. I don't think we need to make this configurable out of the box. A reasonable default may be enough.
This makes an IPv4LL address optional when multiple dynamic addressing protocols are enabled.
Follow-up for 1d370b2.
|
@keszybz Thank you for the comment. Now, the IPv4LL address is dropped after the DHCPv4 address becomes ready. PTAL. |
|
So... what is expected behaviour after we finally acquire the lease? I get the following: $ while ip a show dev host0; do sleep 1; done
2: host0@if40: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 96:aa:3a:7b:d4:b9 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 169.254.40.164/16 brd 169.254.255.255 scope link host0
valid_lft forever preferred_lft forever
inet6 fe80::94aa:3aff:fe7b:d4b9/64 scope link
valid_lft forever preferred_lft forever
...
2: host0@if40: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 96:aa:3a:7b:d4:b9 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 169.254.40.164/16 brd 169.254.255.255 scope link host0
valid_lft forever preferred_lft forever
inet 192.168.102.53/28 brd 192.168.102.63 scope global dynamic host0
valid_lft 3600sec preferred_lft 3600sec
inet6 fe80::94aa:3aff:fe7b:d4b9/64 scope link
valid_lft forever preferred_lft forever
...
2: host0@if40: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 96:aa:3a:7b:d4:b9 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 169.254.40.164/16 brd 169.254.255.255 scope link host0
valid_lft forever preferred_lft forever
inet 192.168.102.53/28 brd 192.168.102.63 scope global dynamic host0
valid_lft 3582sec preferred_lft 3582sec
inet6 fe80::94aa:3aff:fe7b:d4b9/64 scope link
valid_lft forever preferred_lft foreverI.e. the LL address will remain forever. Shouldn't we mark it non-preferred and drop after a minute or so? |
|
Anyway, let's merge this. We can improve on the lifetime later.
If the kernel allow that, I'd like to go from to when the DHCPv4 address is acquired. |
|
The IPv4LL address must be removed. I will prepare a follow-up PR. |
|
I've been following this discussion for a while, but not 100% sure I understand where things stand. The desired behavior (for me) is: network configured in DHCP client mode |
|
The expected behaviour is how you describe it. #17798 even included a test that the ipv4ll address is dropped. Sans bugs, we should be good. |
|
@yuwata : Can you explian the behaviour here? Do we still have the fall back option or it has been deprecated. |
|
@ratagupt The fall back option is now deprecated. IPv4LL is assigned only when DHCP client is disabled or the client does not receive any response from servers. |
|
@yuwata : I tried it on systemd v247 and it didn't work with linklocaladdressing=yes, I can see that LL address was always there even after getting the DHCP address. |
|
Could you open a new issue page with debugging logs? Otherwise, we can easily forget your comment in this already merged and closed page. |
|
I was thinking the ipv4 dhcp/linklocal fallback feature made it into systemd v247, but it seems not. I grabbed yocto-hardknott (latest yocto release), which uses systemd v247.6 and it's pretty clear the changes are not there. From https://layers.openembedded.org/layerindex/recipe/5979/ it looks as if v247 is the most recent version available in any yocto release. I am tempted to patch the 247.6 networkd-dhcp4.c to get this feature. Any advice or suggestions? |
Any updates on this ? |
Replaces #17290.
Fixes #13316.