From 5b083e4e95d5e2f2301d72165b2faf2baf94c21f Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Tue, 11 May 2021 16:58:38 -0400 Subject: [PATCH] bgpd: fix deconfig of conditional advertisement Deconfiguring conditional advertisement resulted in all other policy settings on the peer getting removed due to an excessively large memset. This also created a desync with the northbound config tree, which caused its own set of problems... Fix the memset to just remove the conditional advertisement config. Signed-off-by: Quentin Young --- bgpd/bgpd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 21abfeb001..1778645e9c 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -6891,7 +6891,7 @@ static void peer_advertise_map_filter_update(struct peer *peer, afi_t afi, /* Removed advertise-map configuration */ if (!set) { - memset(filter, 0, sizeof(struct bgp_filter)); + memset(&filter->advmap, 0, sizeof(filter->advmap)); /* decrement condition_filter_count delete timer if * this is the last advertise-map to be removed.