summaryrefslogtreecommitdiff
path: root/proto/bgp/bgp.c
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2019-01-26 19:48:16 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2019-01-26 19:48:16 +0100
commitb8a3608aa59a67364f05dbd0d0332371a200f226 (patch)
treeae5ab5e31d2a95fc357c9ec730fb49548c5f7a20 /proto/bgp/bgp.c
parent5a50a98980a3554b66cedda6992ece4063a0e85a (diff)
BGP: Cleanup channels when going down
When going up, uncleaned old channel state may trigger unexpected conditions crashing bird.
Diffstat (limited to 'proto/bgp/bgp.c')
-rw-r--r--proto/bgp/bgp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c
index 43f9f134..8dedde9f 100644
--- a/proto/bgp/bgp.c
+++ b/proto/bgp/bgp.c
@@ -1692,6 +1692,11 @@ bgp_channel_cleanup(struct channel *C)
if (c->igp_table_ip6)
rt_unlock_table(c->igp_table_ip6);
+
+ c->index = 0;
+
+ /* Cleanup rest of bgp_channel starting at pool field */
+ memset(&(c->pool), 0, sizeof(struct bgp_channel) - OFFSETOF(struct bgp_channel, pool));
}
static inline struct bgp_channel_config *