diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2019-01-04 22:08:10 +0100 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2019-01-18 19:15:41 +0100 |
commit | 2d2eaa136601068130b028b274316edc19ade5c6 (patch) | |
tree | e02598f5d6f26871392a77383111ed7695a5e2bf /ripd/rip_main.c | |
parent | ripngd: fix valgrind warning about uninitialized memory usage (diff) | |
download | frr-2d2eaa136601068130b028b274316edc19ade5c6.tar.xz frr-2d2eaa136601068130b028b274316edc19ade5c6.zip |
ripd: simplify cleaning up of routing instance
* Call rip_clean() only when RIP is configured, this way we can
remove one indentation level from this function.
* rip_redistribute_clean() is only called on shutdown, so there's
no need to call rip_redistribute_withdraw() there since the RIP
table is already cleaned up elsewhere.
* There's no need to clean up the "rip->neighbor" nodes manually before
calling route_table_finish().
* Deallocate the rip structure only at the end of the function. This
prepares the ground for the next commits where all global variables
will be moved to the rip structure.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ripd/rip_main.c')
-rw-r--r-- | ripd/rip_main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ripd/rip_main.c b/ripd/rip_main.c index 5db9c4b7e..e6373664b 100644 --- a/ripd/rip_main.c +++ b/ripd/rip_main.c @@ -81,7 +81,8 @@ static void sigint(void) { zlog_notice("Terminating on signal"); - rip_clean(); + if (rip) + rip_clean(); rip_zclient_stop(); frr_fini(); |