summaryrefslogtreecommitdiff
path: root/ripd/rip_main.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2019-01-04 19:08:10 -0200
committerRenato Westphal <renato@opensourcerouting.org>2019-01-18 16:15:41 -0200
commit045c5389c26347d47b2af6020c3a122398f13efb (patch)
tree82470cd9147b5032bac1d74a2e5b0d6eb42722c3 /ripd/rip_main.c
parent711915d2cdef4dcf41c6921f98de29946cab500e (diff)
ripd: remove the rip global variable
This is the last step to make ripd ready for multi-instance support. Remove the rip global variable and add a "rip" parameter to all functions that need to know the RIP instance they are working on. On some functions, retrieve the RIP instance from the interface variable when it exists (this assumes interfaces can pertain to one RIP instance at most, which is ok for VRF support). In preparation for the next commits (VRF support), add a "vrd_id" member to the rip structure, and use rip->vrf_id instead of VRF_DEFAULT wherever possible. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ripd/rip_main.c')
-rw-r--r--ripd/rip_main.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/ripd/rip_main.c b/ripd/rip_main.c
index 8c6340f6c7..46babe2e0b 100644
--- a/ripd/rip_main.c
+++ b/ripd/rip_main.c
@@ -79,10 +79,17 @@ static void sighup(void)
/* SIGINT handler. */
static void sigint(void)
{
+ struct vrf *vrf;
+
zlog_notice("Terminating on signal");
- if (rip)
- rip_clean();
+ RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) {
+ struct rip *rip;
+
+ rip = vrf->info;
+ if (rip)
+ rip_clean(rip);
+ }
rip_zclient_stop();
frr_fini();