Skip to content

[th/fix-clear-ip6-temp-addrs] l3cfg: during reapply also clear IPv6 temporary addresses

Thomas Haller requested to merge th/fix-clear-ip6-temp-addrs into main

IPv6 temporary addresses are configured by kernel, with the "ipv6.ip6-privacy" setting ("use_tempaddr" sysctl) and the IFA_F_MANAGETEMPADDR flag.

As such, the idea was that during reapply we would not remove them. However, that is wrong.

The only case when we want to keep those addresses, is if during reapply we are going to configure the same primary address (with managetempaddr flag) again. Otherwise, theses addresses must always go away.

This is quite serious. This not only affects Reapply. Also during disconnect we clear IP configuration via l3cfg.

Scenario: Have an ethernet profile active with "ipv6.ip6-privacy". Unplug the cable, the device disconnects but the temporary IPv6 address is not cleared. As such, nm_device_generate_connection() will now generate an external profile (with "ipv6.method=disabled" and no manual IP addresses). The result is, that the device cannot properly autoconnect again, once you replug the cable.

Fixes: 58287cbc ('core: rework IP configuration in NetworkManager using layer 3 configuration')

Merge request reports