]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospf6d: remove own routes on SIGTERM (BZ#448)
authorPhil Laverdiere <phil_laverdiere@securecomputing.com>
Mon, 2 Jan 2012 16:04:26 +0000 (20:04 +0400)
committerDenis Ovsienko <infrastation@yandex.ru>
Tue, 21 Feb 2012 17:35:07 +0000 (21:35 +0400)
ospf6d/ospf6_main.c
ospf6d/ospf6_route.h
ospf6d/ospf6d.c

index d40bd97f3023c523a1ca13f4f8c6122b5220272e..d3ef0a6a82f1de29492b9c2fb243a2175fa694e7 100644 (file)
@@ -180,6 +180,7 @@ static void
 sigterm (void)
 {
   zlog_notice ("Terminating on signal SIGTERM");
+  ospf6_clean();
   ospf6_exit (0);
 }
 
index 8dcc877fa66236f61e2b2fcb565956ed4580f0ed..b384824cb0cf744a40d94dc80c4c12d19c02614c 100644 (file)
@@ -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 */
 
index bb091d4f3c39f151cd3de6bfd8cfed4da236e876..3fdbda18e0fd69db6242797e6a2638c24b5d82bb 100644 (file)
@@ -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);
+}