summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_nht.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-11-06 21:55:36 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-11-07 20:11:45 +0100
commit1ea03b905db2ee97204517057d3fd963cf7d3b6c (patch)
tree6786e5f4c94b8499e9ff5de5a0906c6b7dfb7620 /bgpd/bgp_nht.c
parentMerge pull request #3162 from pguibert6WIND/vpn_route_map_issue (diff)
downloadfrr-1ea03b905db2ee97204517057d3fd963cf7d3b6c.tar.xz
frr-1ea03b905db2ee97204517057d3fd963cf7d3b6c.zip
bgpd: Late registration of Extended Nexthop should allow RA's to happen
When we have a late registration of the Extended Nexthop capability for BGP and the peer already has nexthop information stored, go through and enable RA on the important interfaces. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'bgpd/bgp_nht.c')
-rw-r--r--bgpd/bgp_nht.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c
index 8aa7798af..0dce96f43 100644
--- a/bgpd/bgp_nht.c
+++ b/bgpd/bgp_nht.c
@@ -838,3 +838,48 @@ void bgp_nht_register_nexthops(struct bgp *bgp)
}
}
}
+
+void bgp_nht_register_enhe_capability_interfaces(struct peer *peer)
+{
+ struct bgp *bgp;
+ struct bgp_node *rn;
+ struct bgp_nexthop_cache *bnc;
+ struct nexthop *nhop;
+ struct interface *ifp;
+ struct prefix p;
+
+ if (peer->ifp)
+ return;
+
+ bgp = peer->bgp;
+
+ if (!bgp->nexthop_cache_table[AFI_IP6])
+ return;
+
+ if (!sockunion2hostprefix(&peer->su, &p)) {
+ if (BGP_DEBUG(nht, NHT))
+ zlog_debug("%s: Unable to convert prefix to sockunion",
+ __PRETTY_FUNCTION__);
+ return;
+ }
+
+ if (p.family != AF_INET6)
+ return;
+ rn = bgp_node_lookup(bgp->nexthop_cache_table[AFI_IP6], &p);
+
+ bnc = bgp_nexthop_get_node_info(rn);
+ if (!bnc)
+ return;
+
+ if (peer != bnc->nht_info)
+ return;
+
+ for (nhop = bnc->nexthop; nhop; nhop = nhop->next) {
+ ifp = if_lookup_by_index(nhop->ifindex,
+ nhop->vrf_id);
+ zclient_send_interface_radv_req(zclient,
+ nhop->vrf_id,
+ ifp, true,
+ BGP_UNNUM_DEFAULT_RA_INTERVAL);
+ }
+}