diff options
| author | Daniel Walton <dwalton@cumulusnetworks.com> | 2015-12-07 13:05:34 -0800 |
|---|---|---|
| committer | Daniel Walton <dwalton@cumulusnetworks.com> | 2015-12-07 13:05:34 -0800 |
| commit | b6120505946e08951fdd9adf8539940777cdb635 (patch) | |
| tree | 3008e3241ef3073cab37abc7c41a6a92b3fcbe36 /zebra/interface.c | |
| parent | 2ec1e66ff18df311ec5ed3a94a84b2e709f5441c (diff) | |
Enable IPv6 ND RA for interfaces that have an IPv6 address
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-7932
Diffstat (limited to 'zebra/interface.c')
| -rw-r--r-- | zebra/interface.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/zebra/interface.c b/zebra/interface.c index bd1e404d23..2768e69a6d 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -1730,6 +1730,8 @@ ipv6_address_install (struct vty *vty, struct interface *ifp, /* Add to linked list. */ listnode_add (ifp->connected, ifc); + + ipv6_nd_suppress_ra_set (ifp, RA_ENABLE); } /* This address is configured from zebra. */ @@ -1765,6 +1767,20 @@ ipv6_address_install (struct vty *vty, struct interface *ifp, return CMD_SUCCESS; } +/* Return true if an ipv6 address is configured on ifp */ +int +ipv6_address_configured (struct interface *ifp) +{ + struct connected *connected; + struct listnode *node; + + for (ALL_LIST_ELEMENTS_RO (ifp->connected, node, connected)) + if (CHECK_FLAG (connected->conf, ZEBRA_IFC_REAL) && (connected->address->family == AF_INET6)) + return 1; + + return 0; +} + static int ipv6_address_uninstall (struct vty *vty, struct interface *ifp, const char *addr_str, const char *peer_str, @@ -1814,6 +1830,10 @@ ipv6_address_uninstall (struct vty *vty, struct interface *ifp, return CMD_WARNING; } + /* Enable RA suppression if there are no IPv6 addresses on this interface */ + if (! ipv6_address_configured(ifp)) + ipv6_nd_suppress_ra_set (ifp, RA_SUPPRESS); + UNSET_FLAG (ifc->conf, ZEBRA_IFC_QUEUED); /* This information will be propagated to the zclients when the * kernel notification is received. */ |
