*: call if_init()/if_terminate() from vrf_init()/vrf_terminate()
Later, an interface will belong to a specific VRF, and the interface
initialization will be a part of the VRF initialization. So now call
if_init() from vrf_init(), and if_terminate() from vrf_terminate().
Daemons have the according changes:
- if if_init() was called or "iflist" was initialized, now call
vrf_init() instead;
- if if_terminate() was called or "iflist" was destroyed, now call
vrf_terminate() instead.
Signed-off-by: Feng Lu <lu.feng@6wind.com>
Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Vincent JARDIN <vincent.jardin@6wind.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
diff --git a/pimd/pimd.c b/pimd/pimd.c
index 855defc..78c3ff5 100644
--- a/pimd/pimd.c
+++ b/pimd/pimd.c
@@ -24,6 +24,7 @@
#include "log.h"
#include "memory.h"
+#include "vrf.h"
#include "pimd.h"
#include "pim_cmd.h"
@@ -130,12 +131,12 @@
qpim_infinite_assert_metric.route_metric = PIM_ASSERT_ROUTE_METRIC_MAX;
qpim_infinite_assert_metric.ip_address = qpim_inaddr_any;
- pim_if_init();
pim_cmd_init();
pim_ssmpingd_init();
}
void pim_terminate()
{
+ vrf_terminate();
pim_free();
}