summaryrefslogtreecommitdiff
path: root/bgpd
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2019-01-21 17:19:53 +0100
committerPhilippe Guibert <philippe.guibert@6wind.com>2019-02-18 15:52:35 +0100
commitf31a4bb9c096e0ccdb5d4c529fee71ea6bd392f4 (patch)
tree573e125ecd4377e605de36d373a4b679e65914bd /bgpd
parent8862b2f86ff7671bc60276c2dd6bf3aa9496c7c3 (diff)
bgpd: do not crash when removing ip vpn entries
when removing bgp instance, the parsing of rm->info contexts must be protected. Also, the main level of hierarchy of rds must not be allocated more than once. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_route.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 31cd3d1f05..4928eb50e5 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -5069,6 +5069,9 @@ void bgp_static_delete(struct bgp *bgp)
bgp_static =
bgp_node_get_bgp_static_info(
rm);
+ if (!bgp_static)
+ continue;
+
bgp_static_withdraw_safi(
bgp, &rm->p, AFI_IP, safi,
(struct prefix_rd *)&rn->p);
@@ -5245,8 +5248,6 @@ int bgp_static_set_safi(afi_t afi, safi_t safi, struct vty *vty,
if (!bgp_node_has_bgp_path_info_data(prn))
bgp_node_set_bgp_table_info(prn,
bgp_table_init(bgp, afi, safi));
- else
- bgp_unlock_node(prn);
table = bgp_node_get_bgp_table_info(prn);
rn = bgp_node_get(table, &p);