diff options
author | vivek <vivek@cumulusnetworks.com> | 2016-05-13 01:51:43 +0200 |
---|---|---|
committer | vivek <vivek@cumulusnetworks.com> | 2016-05-13 01:51:43 +0200 |
commit | 5c81b96acaf5e08e1a323c31dafd764ad82a0503 (patch) | |
tree | 017cc844599e7fa686ce3654e60683604e5777e7 /zebra | |
parent | Fix unprotected debugs to warns and fix (diff) | |
download | frr-5c81b96acaf5e08e1a323c31dafd764ad82a0503.tar.xz frr-5c81b96acaf5e08e1a323c31dafd764ad82a0503.zip |
BGP: Set advertisement interval when triggering IPv6 RAs
This change extends the earlier change which added the ability in BGP to
trigger IPv6 Router Advertisements when an unnumbered neighbor is configured.
In addition to triggering the RAs, the advertisement interval is also set to
10 seconds. This is needed to handle the scenario where the peer may start
later.
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-10896
Reviewed By: CCR-4693
Testing Done: Manual, bgp-min, bgp-smoke
Diffstat (limited to 'zebra')
-rw-r--r-- | zebra/rtadv.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/zebra/rtadv.c b/zebra/rtadv.c index 003459dd5..d4d48988c 100644 --- a/zebra/rtadv.c +++ b/zebra/rtadv.c @@ -799,7 +799,8 @@ ipv6_nd_suppress_ra_set (struct interface *ifp, ipv6_nd_suppress_ra_status statu * Handle client (BGP) message to enable or disable IPv6 RA on an interface. * Note that while the client could request RA on an interface on which the * operator has not enabled RA, RA won't be disabled upon client request - * if the operator has explicitly enabled RA. + * if the operator has explicitly enabled RA. The enable request can also + * specify a RA interval (in seconds). */ void zebra_interface_radv_set (struct zserv *client, int sock, u_short length, @@ -809,16 +810,18 @@ zebra_interface_radv_set (struct zserv *client, int sock, u_short length, unsigned int ifindex; struct interface *ifp; struct zebra_if *zif; + int ra_interval; s = client->ibuf; - /* Get interface index. */ + /* Get interface index and RA interval. */ ifindex = stream_getl (s); + ra_interval = stream_getl (s); if (IS_ZEBRA_DEBUG_EVENT) - zlog_debug("%u: IF %u RA %s from client %s", + zlog_debug("%u: IF %u RA %s from client %s, interval %ds", zvrf->vrf_id, ifindex, enable ? "enable" : "disable", - zebra_route_string(client->proto)); + zebra_route_string(client->proto), ra_interval); /* Locate interface and check VRF match. */ ifp = if_lookup_by_index_per_ns (zebra_ns_lookup (NS_DEFAULT), ifindex); @@ -839,11 +842,19 @@ zebra_interface_radv_set (struct zserv *client, int sock, u_short length, zif = ifp->info; if (enable) - ipv6_nd_suppress_ra_set (ifp, RA_ENABLE); + { + ipv6_nd_suppress_ra_set (ifp, RA_ENABLE); + if (ra_interval && + (ra_interval * 1000) < zif->rtadv.MaxRtrAdvInterval) + zif->rtadv.MaxRtrAdvInterval = ra_interval * 1000; + } else { if (!zif->rtadv.configured) - ipv6_nd_suppress_ra_set (ifp, RA_SUPPRESS); + { + zif->rtadv.MaxRtrAdvInterval = RTADV_MAX_RTR_ADV_INTERVAL; + ipv6_nd_suppress_ra_set (ifp, RA_SUPPRESS); + } } } |