]> git.proxmox.com Git - mirror_frr.git/commitdiff
*: make all daemons call frr_fini() on exit
authorRenato Westphal <renato@opensourcerouting.org>
Tue, 12 Sep 2017 02:05:16 +0000 (23:05 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Tue, 12 Sep 2017 14:25:16 +0000 (11:25 -0300)
This allow us to find real leaks more easily with tools like valgrind.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
babeld/babel_main.c
eigrpd/eigrpd.c
isisd/isis_zebra.c
ospfd/ospfd.c
pimd/pimd.c
ripd/rip_main.c
ripngd/ripng_main.c

index 54626a4aeb5904c10b89f7ed6d9aa3851e956ebf..6a8f9bb75f59f110e1362dde592d18614fa2ad9a 100644 (file)
@@ -335,6 +335,7 @@ babel_exit_properly(void)
     babel_save_state_file();
     debugf(BABEL_DEBUG_COMMON, "Remove pid file.");
     debugf(BABEL_DEBUG_COMMON, "Done.");
+    frr_fini();
 
     exit(0);
 }
index 99d88b2d006fec0bb6fae0b5ca205add48cb418a..ee60898f866d929b80314d781f172a3b03aafd0b 100644 (file)
@@ -42,6 +42,7 @@
 #include "plist.h"
 #include "sockopt.h"
 #include "keychain.h"
+#include "libfrr.h"
 
 #include "eigrpd/eigrp_structs.h"
 #include "eigrpd/eigrpd.h"
@@ -241,12 +242,10 @@ void eigrp_terminate(void)
 
        SET_FLAG(eigrp_om->options, EIGRP_MASTER_SHUTDOWN);
 
-       /* exit immediately if EIGRP not actually running */
-       if (listcount(eigrp_om->eigrp) == 0)
-               exit(0);
-
        for (ALL_LIST_ELEMENTS(eigrp_om->eigrp, node, nnode, eigrp))
                eigrp_finish(eigrp);
+
+       frr_fini();
 }
 
 void eigrp_finish(struct eigrp *eigrp)
index ed96bd31c29867d17e40d3b53d8343ce1fc7c8fe..99eb698b75f155777dd9307b1f8b9f073f52af1b 100644 (file)
@@ -35,6 +35,7 @@
 #include "linklist.h"
 #include "nexthop.h"
 #include "vrf.h"
+#include "libfrr.h"
 
 #include "isisd/dict.h"
 #include "isisd/isis_constants.h"
@@ -427,4 +428,5 @@ void isis_zebra_stop(void)
 {
        zclient_stop(zclient);
        zclient_free(zclient);
+       frr_fini();
 }
index 20cee713bddd78e8c914a13833055bb9ff821342..ed1d8901fb4e77f7425328b6d2a336443b5f75b1 100644 (file)
@@ -35,6 +35,7 @@
 #include "plist.h"
 #include "sockopt.h"
 #include "bfd.h"
+#include "libfrr.h"
 #include "defaults.h"
 
 #include "ospfd/ospfd.h"
@@ -489,6 +490,8 @@ void ospf_terminate(void)
         */
        zclient_stop(zclient);
        zclient_free(zclient);
+
+       frr_fini();
 }
 
 void ospf_finish(struct ospf *ospf)
index 9a8e92cbb240cf562a8803703d8d75a177205cc9..37c79d45548f216c93b4a48bcd3a82a3ac20e182 100644 (file)
@@ -139,4 +139,6 @@ void pim_terminate()
                zclient_stop(zclient);
                zclient_free(zclient);
        }
+
+       frr_fini();
 }
index 91b623beb40b16057e4e62bee75c4950f39e6eec..9a448e895890fdc9dd18e0362eacaa18d5aa944e 100644 (file)
@@ -89,6 +89,7 @@ static void sigint(void)
                rip_clean();
 
        rip_zclient_stop();
+       frr_fini();
 
        exit(0);
 }
index 0cb54d43356c728cb03198a7d53e5b6be2c3dd61..8ef27daabaacf8ae93d12b2052a0fe69679f7bdf 100644 (file)
@@ -92,6 +92,7 @@ static void sigint(void)
                ripng_clean();
 
        ripng_zebra_stop();
+       frr_fini();
        exit(0);
 }