From: Phil Laverdiere Date: Mon, 2 Jan 2012 16:04:26 +0000 (+0400) Subject: ospf6d: remove own routes on SIGTERM (BZ#448) X-Git-Tag: frr-2.0-rc1~1893 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=ef2d5d100431031c32ea35b3c834b46cff16f511;p=mirror%2Ffrr.git ospf6d: remove own routes on SIGTERM (BZ#448) --- diff --git a/ospf6d/ospf6_main.c b/ospf6d/ospf6_main.c index d40bd97f30..d3ef0a6a82 100644 --- a/ospf6d/ospf6_main.c +++ b/ospf6d/ospf6_main.c @@ -180,6 +180,7 @@ static void sigterm (void) { zlog_notice ("Terminating on signal SIGTERM"); + ospf6_clean(); ospf6_exit (0); } diff --git a/ospf6d/ospf6_route.h b/ospf6d/ospf6_route.h index 8dcc877fa6..b384824cb0 100644 --- a/ospf6d/ospf6_route.h +++ b/ospf6d/ospf6_route.h @@ -300,6 +300,7 @@ extern void ospf6_brouter_show (struct vty *vty, struct ospf6_route *route); extern int config_write_ospf6_debug_route (struct vty *vty); extern void install_element_ospf6_debug_route (void); extern void ospf6_route_init (void); +extern void ospf6_clean (void); #endif /* OSPF6_ROUTE_H */ diff --git a/ospf6d/ospf6d.c b/ospf6d/ospf6d.c index bb091d4f3c..3fdbda18e0 100644 --- a/ospf6d/ospf6d.c +++ b/ospf6d/ospf6d.c @@ -1889,4 +1889,11 @@ ospf6_init (void) thread_add_read (master, ospf6_receive, NULL, ospf6_sock); } - +void +ospf6_clean (void) +{ + if (ospf6->route_table) + ospf6_route_remove_all (ospf6->route_table); + if (ospf6->brouter_table) + ospf6_route_remove_all (ospf6->brouter_table); +}