summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_nht.h
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-10-17 17:27:30 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-10-17 17:27:30 +0200
commit7f040da1a18981277a1db29764a3dc6f0e7d2f10 (patch)
tree72244bcfefbcbab0c33ac650ff24ef807ac67a5f /bgpd/bgp_nht.h
parentMerge pull request #3179 from donaldsharp/vni_cmp (diff)
downloadfrr-7f040da1a18981277a1db29764a3dc6f0e7d2f10.tar.xz
frr-7f040da1a18981277a1db29764a3dc6f0e7d2f10.zip
bgpd: Fix crash when using v4 route w/ v6 nexthop
Recent changes to the nht code in bgp caused us to actually keep a true count of v6 nexthop paths when using v4 over v6. This change introduced a race condition on shutdown on who got to the bnc cache first( the v4 table or not ). Effectively we were allowing the continued existence of the path->nexthop pointing to the freed bnc. This was especially true when we had route leaking. So when we free the bnc make sure we clean up the path->nexthop variables pointing at it too. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'bgpd/bgp_nht.h')
-rw-r--r--bgpd/bgp_nht.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/bgpd/bgp_nht.h b/bgpd/bgp_nht.h
index 7b29fa818..0cc045a06 100644
--- a/bgpd/bgp_nht.h
+++ b/bgpd/bgp_nht.h
@@ -75,4 +75,11 @@ extern void bgp_delete_connected_nexthop(afi_t afi, struct peer *peer);
*/
extern void bgp_cleanup_nexthops(struct bgp *bgp);
+/*
+ * Add or remove the tracking of the bgp_path_info that
+ * uses this nexthop
+ */
+extern void path_nh_map(struct bgp_path_info *path,
+ struct bgp_nexthop_cache *bnc, bool make);
+
#endif /* _BGP_NHT_H */