summaryrefslogtreecommitdiff
path: root/zebra/if_netlink.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@openbsd.org>2019-01-29 14:35:09 -0200
committerGitHub <noreply@github.com>2019-01-29 14:35:09 -0200
commit718cfa14f48ea3b8f298c50cbb1a49f13bcfed02 (patch)
tree1ec429a8eeb37af60f1053f7988b982c50c56bba /zebra/if_netlink.c
parent185fd9ca77e6f03c9c59eb97ab9fca79bbd57b64 (diff)
parent9254efede1c744060a50988a1d574a6027a9e66e (diff)
Merge pull request #3687 from donaldsharp/ifp_flags
zebra: Use the kernel flags from the IFA_FLAGS if it is available
Diffstat (limited to 'zebra/if_netlink.c')
-rw-r--r--zebra/if_netlink.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c
index 47087d4ce0..faca52fe41 100644
--- a/zebra/if_netlink.c
+++ b/zebra/if_netlink.c
@@ -925,6 +925,7 @@ int netlink_interface_addr(struct nlmsghdr *h, ns_id_t ns_id, int startup)
char *label = NULL;
struct zebra_ns *zns;
uint32_t metric = METRIC_MAX;
+ uint32_t kernel_flags = 0;
zns = zebra_ns_lookup(ns_id);
ifa = NLMSG_DATA(h);
@@ -961,12 +962,18 @@ int netlink_interface_addr(struct nlmsghdr *h, ns_id_t ns_id, int startup)
return -1;
}
+ /* Flags passed through */
+ if (tb[IFA_FLAGS])
+ kernel_flags = *(int *)RTA_DATA(tb[IFA_FLAGS]);
+ else
+ kernel_flags = ifa->ifa_flags;
+
if (IS_ZEBRA_DEBUG_KERNEL) /* remove this line to see initial ifcfg */
{
char buf[BUFSIZ];
zlog_debug("netlink_interface_addr %s %s flags 0x%x:",
nl_msg_type_to_str(h->nlmsg_type), ifp->name,
- ifa->ifa_flags);
+ kernel_flags);
if (tb[IFA_LOCAL])
zlog_debug(" IFA_LOCAL %s/%d",
inet_ntop(ifa->ifa_family,
@@ -1023,7 +1030,7 @@ int netlink_interface_addr(struct nlmsghdr *h, ns_id_t ns_id, int startup)
}
/* Flags. */
- if (ifa->ifa_flags & IFA_F_SECONDARY)
+ if (kernel_flags & IFA_F_SECONDARY)
SET_FLAG(flags, ZEBRA_IFA_SECONDARY);
/* Label */
@@ -1070,7 +1077,7 @@ int netlink_interface_addr(struct nlmsghdr *h, ns_id_t ns_id, int startup)
* time, Quagga
* does query for and will receive all addresses.
*/
- if (!(ifa->ifa_flags
+ if (!(kernel_flags
& (IFA_F_DADFAILED | IFA_F_TENTATIVE)))
connected_add_ipv6(ifp, flags,
(struct in6_addr *)addr,