diff --git a/zebra/main.c b/zebra/main.c index 4673ec53e4..306372ccdb 100644 --- a/zebra/main.c +++ b/zebra/main.c @@ -174,6 +174,7 @@ static void sigint(void) work_queue_free_and_null(&zrouter.lsp_process_q); vrf_terminate(); + rtadv_terminate(); ns_walk_func(zebra_ns_early_shutdown); zebra_ns_notify_close(); diff --git a/zebra/rtadv.c b/zebra/rtadv.c index 60ac471b5a..4a553a4269 100644 --- a/zebra/rtadv.c +++ b/zebra/rtadv.c @@ -2371,18 +2371,24 @@ void rtadv_init(struct zebra_vrf *zvrf) } } -void rtadv_terminate(struct zebra_vrf *zvrf) +void rtadv_vrf_terminate(struct zebra_vrf *zvrf) { rtadv_event(zvrf, RTADV_STOP, 0); if (zvrf->rtadv.sock >= 0) { close(zvrf->rtadv.sock); zvrf->rtadv.sock = -1; - } else if (zrouter.rtadv_sock >= 0) { + } + + zvrf->rtadv.adv_if_count = 0; + zvrf->rtadv.adv_msec_if_count = 0; +} + +void rtadv_terminate(void) +{ + if (zrouter.rtadv_sock >= 0) { close(zrouter.rtadv_sock); zrouter.rtadv_sock = -1; } - zvrf->rtadv.adv_if_count = 0; - zvrf->rtadv.adv_msec_if_count = 0; } void rtadv_cmd_init(void) diff --git a/zebra/rtadv.h b/zebra/rtadv.h index 64b28cbfd6..68a5bbcdbe 100644 --- a/zebra/rtadv.h +++ b/zebra/rtadv.h @@ -153,7 +153,8 @@ typedef enum { } ipv6_nd_suppress_ra_status; extern void rtadv_init(struct zebra_vrf *zvrf); -extern void rtadv_terminate(struct zebra_vrf *zvrf); +extern void rtadv_vrf_terminate(struct zebra_vrf *zvrf); +extern void rtadv_terminate(void); extern void rtadv_stop_ra(struct interface *ifp); extern void rtadv_stop_ra_all(void); extern void rtadv_cmd_init(void); diff --git a/zebra/zebra_vrf.c b/zebra/zebra_vrf.c index dfa7d5ae92..ee1e251a69 100644 --- a/zebra/zebra_vrf.c +++ b/zebra/zebra_vrf.c @@ -178,7 +178,7 @@ static int zebra_vrf_disable(struct vrf *vrf) zebra_vxlan_vrf_disable(zvrf); #if defined(HAVE_RTADV) - rtadv_terminate(zvrf); + rtadv_vrf_terminate(zvrf); #endif /* Inform clients that the VRF is now inactive. This is a