kernel-netlink: Update cached address flags

Note that manually adding an IPv6 address without disabling duplicate
address detection (DAD, e.g. via `nodad` when using iproute2) will cause
a roam event due to a flag change after about 1-2 seconds (TENTATIVE is
removed).  If this is a problem, we might have to ignore addresses with
TENTATIVE flag when we receive a RTM_NEWADDR message until that flag is
eventually removed.

Fixes #3511.
This commit is contained in:
Tobias Brunner 2020-10-15 16:10:07 +02:00
parent 266e2dbbea
commit 2eb43ca405
1 changed files with 11 additions and 0 deletions

View File

@ -1278,6 +1278,17 @@ static void process_addr(private_kernel_netlink_net_t *this,
addr_map_entry_remove(this->addrs, addr, iface);
addr_entry_destroy(addr);
}
else if (entry->addr->flags != msg->ifa_flags)
{
found = TRUE;
entry->addr->flags = msg->ifa_flags;
if (event && iface->usable)
{
changed = TRUE;
DBG1(DBG_KNL, "flags changed for %H on %s", host,
iface->ifname);
}
}
}
else
{