summaryrefslogtreecommitdiffhomepage
path: root/src/netlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/netlink.c')
-rw-r--r--src/netlink.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/netlink.c b/src/netlink.c
index 4a352a6..0a2da03 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -386,7 +386,7 @@ static int handle_rtm_addr(struct nlmsghdr *hdr, bool add)
nla_memcpy(&event_info.addr, nla[IFA_ADDRESS], sizeof(event_info.addr));
- if (IN6_IS_ADDR_LINKLOCAL(&event_info.addr) || IN6_IS_ADDR_MULTICAST(&event_info.addr))
+ if (IN6_IS_ADDR_MULTICAST(&event_info.addr))
return NL_SKIP;
inet_ntop(AF_INET6, &event_info.addr, buf, sizeof(buf));
@@ -395,6 +395,11 @@ static int handle_rtm_addr(struct nlmsghdr *hdr, bool add)
if (iface->ifindex != (int)ifa->ifa_index)
continue;
+ if (add && IN6_IS_ADDR_LINKLOCAL(&event_info.addr)) {
+ iface->have_link_local = true;
+ return NL_SKIP;
+ }
+
syslog(LOG_DEBUG, "Netlink %s %s on %s", add ? "newaddr" : "deladdr",
buf, iface->name);
@@ -625,6 +630,10 @@ static int cb_addr_valid(struct nl_msg *msg, void *arg)
if (ifa->ifa_flags & IFA_F_DEPRECATED)
addrs[ctxt->ret].preferred = 0;
+ if (ifa->ifa_family == AF_INET6 &&
+ ifa->ifa_flags & IFA_F_TENTATIVE)
+ addrs[ctxt->ret].tentative = true;
+
ctxt->ret++;
*(ctxt->addrs) = addrs;