Problem with IPv6 when router advertises prefix with preferred_lifetime == 0
Summary
Router advertisement message from router (when preferred lifetime of one of the prefixes in RA message is 0) causes unwanted events about change in network configuration generated by system. In turn, it causes records like this in system logs (I see logs with journalctl -f):
23:32:39 fedora avahi-daemon[810]: Registering new address record for fdaa:bbcc:ddee:0:bcab:de83:cf72:9e49 on enp0s1.*.
23:32:40 fedora avahi-daemon[810]: Withdrawing address record for fdaa:bbcc:ddee:0:bcab:de83:cf72:9e49 on enp0s1.
Also sometimes this causes other side effects. For example, sometimes I see error ERR_NETWORK_CHANGED in Google Chrome when router advertisement message comes from router and some website is loading at the moment.
What happens in details
My home router sends an RA message approximately every minute. And as soon as it does the following things happens (as far as I understand it from logs):
-
ndisc get the message and passes it to l3cfg. The important things is that preferred lifetime of one of the prefixes is 0):
-
l3cfg applies new configuration, but for some reasons the prefix's preferred lifetime becomes 1 sec (I use
ip monitor
to monitor changes):enp0s1 inet6 fdaa:bbcc:ddee:0:bcab:de83:cf72:9e49/64 scope global tentative dynamic noprefixroute valid_lft 2005955213sec preferred_lft 1sec
And this is incorrect because this ip address has wrong preferred_lft value now. Also the ip address doesn't have
deprecated
attribute. This is incorrect because router explicitly asked my PC to make the ip address deprecated (i. e. it shouldn't be used as a source address). -
Right after one second the ip address becomes deprecated (as it should be) and preferred_lft changes to 0 seconds.
enp0s1 inet6 fdaa:bbcc:ddee:0:bcab:de83:cf72:9e49/64 scope global deprecated dynamic noprefixroute valid_lft 2005955212sec preferred_lft 0sec
This is a correct state now. But during that second the system was in the incorrect state (because ip address that should have
deprecated
attribute didn't have it). Also it causes side effects that was mentioned above. -
After approx. a minute (when the next RA message comes) the sequence repeats and annoys me.
There's a question at StackExchange that looks like it's related to the issue: https://unix.stackexchange.com/questions/765200/why-can-the-lifetimes-reported-by-ip-address-be-slightly-higher-than-the-content.
Version affected
Fedora Linux 39 (6.6.11-200.fc39.aarch64)
nmcli version 1.44.2-1.fc39
Relevant logs
I attach full system logs that I got invoking journalctl -f
command with NetworkManager's TRACE logs enabled.