]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
kernel-netlink: Update cached address flags
authorTobias Brunner <tobias@strongswan.org>
Thu, 15 Oct 2020 14:10:07 +0000 (16:10 +0200)
committerTobias Brunner <tobias@strongswan.org>
Thu, 29 Oct 2020 08:46:14 +0000 (09:46 +0100)
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.

src/libcharon/plugins/kernel_netlink/kernel_netlink_net.c

index f174c269870720654de23b4df144ff018502a9a6..57a26b7deb8a0246be3fd2b7454e138fb5822d89 100644 (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
                {