summaryrefslogtreecommitdiff
path: root/ripngd/ripng_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
commit5c84b9a58153f89379e3a99e02173662ea390489 (patch)
treeea4f0cf53f25e43ace1eeb7b3028cba9526e6859 /ripngd/ripng_main.c
parent26c6be9314b4013cedaf0a9f5ff5d65ca4ae685b (diff)
ripngd: remove the ripng global variable
This is the last step to make ripngd ready for multi-instance support. Remove the ripng global variable and add a "ripng" parameter to all functions that need to know the RIPng instance they are working on. On some functions, retrieve the RIPng instance from the interface variable when it exists (this assumes interfaces can pertain to one RIPng instance at most, which is ok for VRF support). In preparation for the next commits (VRF support), add a "vrd_id" member to the ripng structure, and use ripng->vrf_id instead of VRF_DEFAULT wherever possible. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ripngd/ripng_main.c')
-rw-r--r--ripngd/ripng_main.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/ripngd/ripng_main.c b/ripngd/ripng_main.c
index 26d602e1a5..e7246efc43 100644
--- a/ripngd/ripng_main.c
+++ b/ripngd/ripng_main.c
@@ -80,10 +80,17 @@ static void sighup(void)
/* SIGINT handler. */
static void sigint(void)
{
+ struct vrf *vrf;
+
zlog_notice("Terminating on signal");
- if (ripng)
- ripng_clean();
+ RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) {
+ struct ripng *ripng;
+
+ ripng = vrf->info;
+ if (ripng)
+ ripng_clean(ripng);
+ }
ripng_zebra_stop();
frr_fini();