summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_main.c
diff options
context:
space:
mode:
authorvivek <vivek@cumulusnetworks.com>2016-05-07 07:07:58 +0200
committervivek <vivek@cumulusnetworks.com>2016-05-07 07:07:58 +0200
commit021530c1e3e4f67a313e4c34536bd513809e2054 (patch)
treecd3411ff0ff54842aa22835972aecb564a21869b /bgpd/bgp_main.c
parentdebian: Update changelog (diff)
downloadfrr-021530c1e3e4f67a313e4c34536bd513809e2054.tar.xz
frr-021530c1e3e4f67a313e4c34536bd513809e2054.zip
BGP: At exit, remove callbacks before invoking vrf_terminate()
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com> Ticket: CM-10831 Reviewed By: CCR-4657 Testing Done: Manual
Diffstat (limited to 'bgpd/bgp_main.c')
-rw-r--r--bgpd/bgp_main.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/bgpd/bgp_main.c b/bgpd/bgp_main.c
index 1f7d0ea49..656f49d18 100644
--- a/bgpd/bgp_main.c
+++ b/bgpd/bgp_main.c
@@ -79,6 +79,7 @@ void sigint (void);
void sigusr1 (void);
static void bgp_exit (int);
+static void bgp_vrf_terminate (void);
static struct quagga_signal_t bgp_signals[] =
{
@@ -268,7 +269,7 @@ bgp_exit (int status)
/* reverse community_list_init */
community_list_terminate (bgp_clist);
- vrf_terminate ();
+ bgp_vrf_terminate ();
cmd_terminate ();
vty_terminate ();
if (zclient)
@@ -369,6 +370,17 @@ bgp_vrf_init (void)
vrf_init ();
}
+static void
+bgp_vrf_terminate (void)
+{
+ vrf_add_hook (VRF_NEW_HOOK, NULL);
+ vrf_add_hook (VRF_ENABLE_HOOK, NULL);
+ vrf_add_hook (VRF_DISABLE_HOOK, NULL);
+ vrf_add_hook (VRF_DELETE_HOOK, NULL);
+
+ vrf_terminate ();
+}
+
/* Main routine of bgpd. Treatment of argument and start bgp finite
state machine is handled at here. */
int