platform: detect dadfailed IPv6 addresses during pruning

If an address is removed during pruning and it had the TENTATIVE flag
before, the most likely cause of the removal is that it failed DAD. It
could also be that the user removed it at the same time we needed to
resync the platform cache, but that seems more unlikely.
This commit is contained in:
Beniamino Galvani 2022-09-29 14:18:18 +02:00
parent 3f84ee27a0
commit 9feffe7ad4

View file

@ -6759,6 +6759,14 @@ cache_prune_one_type(NMPlatform *platform, const NMPLookup *lookup)
obj = main_entry->obj;
if (NMP_OBJECT_GET_TYPE(obj) == NMP_OBJECT_TYPE_IP6_ADDRESS) {
const NMPlatformIP6Address *pladdr = NMP_OBJECT_CAST_IP6_ADDRESS(obj);
if (pladdr->n_ifa_flags & IFA_F_TENTATIVE) {
nm_platform_ip6_dadfailed_set(platform, pladdr->ifindex, &pladdr->address, TRUE);
}
}
_LOGt("cache-prune: prune %s",
nmp_object_to_string(obj, NMP_OBJECT_TO_STRING_ALL, sbuf, sizeof(sbuf)));