summaryrefslogtreecommitdiff
path: root/zebra/rt_netlink.c
diff options
context:
space:
mode:
authorvivek <vivek@cumulusnetworks.com>2016-02-18 18:47:32 -0800
committervivek <vivek@cumulusnetworks.com>2016-02-18 18:47:32 -0800
commit30a3822f2bc1db2fa3fbee8bec42898996ecbb07 (patch)
treea7928b1aa1f591ca8d6eab53f09420896605ff67 /zebra/rt_netlink.c
parent048cb054189c7d9872ce60c85d8915426aeb7d2e (diff)
Zebra: Restrict automatic RA enable to relevant interfaces
When enabling IPv6 Router Advertisements automatically based on the presence of IPv6 address on an interface, do it only for relevant interfaces. Note: This needs a configure option for completion. Ticket: CM-9358 Reviewed By: CCR-4116 Testing Done: Manual verification
Diffstat (limited to 'zebra/rt_netlink.c')
-rw-r--r--zebra/rt_netlink.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index 54652b8531..61dd8b620e 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -1221,8 +1221,6 @@ netlink_link_change (struct sockaddr_nl *snl, struct nlmsghdr *h,
char *name = NULL;
char *kind = NULL;
char *slave_kind = NULL;
- struct connected *ifc;
- struct listnode *node;
vrf_id_t vrf_id = ns_id;
@@ -1295,9 +1293,11 @@ netlink_link_change (struct sockaddr_nl *snl, struct nlmsghdr *h,
{
if_down (ifp); //Ideally, we should have down/delete come from kernel
// if_delete_update (ifp); //Pending: see how best to make the old ifp unusable
- for (ALL_LIST_ELEMENTS_RO (ifp->connected, node, ifc))
- if (ifc->address->family == AF_INET6)
- ipv6_nd_suppress_ra_set (ifp, RA_SUPPRESS);
+ if (interface_ipv6_auto_ra_allowed (ifp))
+ {
+ if (ipv6_address_configured (ifp))
+ ipv6_nd_suppress_ra_set (ifp, RA_SUPPRESS);
+ }
}
if (ifp == NULL || !CHECK_FLAG (ifp->status, ZEBRA_INTERFACE_ACTIVE) ||
@@ -1309,9 +1309,11 @@ netlink_link_change (struct sockaddr_nl *snl, struct nlmsghdr *h,
{
if_update_vrf (ifp, name, strlen(name), vrf_id);
- for (ALL_LIST_ELEMENTS_RO (ifp->connected, node, ifc))
- if (ifc->address->family == AF_INET6)
- ipv6_nd_suppress_ra_set (ifp, RA_ENABLE);
+ if (interface_ipv6_auto_ra_allowed (ifp))
+ {
+ if (ipv6_address_configured (ifp))
+ ipv6_nd_suppress_ra_set (ifp, RA_ENABLE);
+ }
}
set_ifindex(ifp, ifi->ifi_index);