*: 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/lib/vrf.c b/lib/vrf.c
index 3ccbb99..51f9e37 100644
--- a/lib/vrf.c
+++ b/lib/vrf.c
@@ -22,6 +22,7 @@
#include <zebra.h>
+#include "if.h"
#include "vrf.h"
#include "prefix.h"
#include "table.h"
@@ -249,6 +250,8 @@
/* Set the default VRF name. */
default_vrf->name = XSTRDUP (MTYPE_VRF_NAME, "Default-IP-Routing-Table");
+
+ if_init ();
}
/* Terminate VRF module. */
@@ -264,5 +267,7 @@
route_table_finish (vrf_table);
vrf_table = NULL;
+
+ if_terminate ();
}