diff options
author | Feng Lu <lu.feng@6wind.com> | 2015-05-22 11:39:58 +0200 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2015-06-02 06:58:12 +0200 |
commit | 126215c1238eb42cc92d23aefbe1fac3b204438f (patch) | |
tree | 22910b50f39003e297efc6236711581cbf3b2ada /bgpd | |
parent | 2fc97f6335dd5d7df2c285b363c6ef56bb98dcf8 (diff) | |
download | quagga-126215c1238eb42cc92d23aefbe1fac3b204438f.tar.bz2 quagga-126215c1238eb42cc92d23aefbe1fac3b204438f.tar.xz |
*: 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>
Diffstat (limited to 'bgpd')
-rw-r--r-- | bgpd/bgp_main.c | 8 | ||||
-rw-r--r-- | bgpd/bgp_zebra.c | 3 |
2 files changed, 4 insertions, 7 deletions
diff --git a/bgpd/bgp_main.c b/bgpd/bgp_main.c index 5026b5ea..ad4de798 100644 --- a/bgpd/bgp_main.c +++ b/bgpd/bgp_main.c @@ -36,6 +36,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA #include "filter.h" #include "plist.h" #include "stream.h" +#include "vrf.h" #include "bgpd/bgpd.h" #include "bgpd/bgp_attr.h" @@ -248,17 +249,14 @@ bgp_exit (int status) /* reverse bgp_zebra_init/if_init */ if (retain_mode) if_add_hook (IF_DELETE_HOOK, NULL); - for (ALL_LIST_ELEMENTS (iflist, node, nnode, ifp)) + for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp)) { struct listnode *c_node, *c_nnode; struct connected *c; for (ALL_LIST_ELEMENTS (ifp->connected, c_node, c_nnode, c)) bgp_connected_delete (c); - - if_delete (ifp); } - list_free (iflist); /* reverse bgp_attr_init */ bgp_attr_finish (); @@ -293,6 +291,7 @@ bgp_exit (int status) /* reverse community_list_init */ community_list_terminate (bgp_clist); + vrf_terminate (); cmd_terminate (); vty_terminate (); if (zclient) @@ -427,6 +426,7 @@ main (int argc, char **argv) cmd_init (1); vty_init (master); memory_init (); + vrf_init (); /* BGP related initialization. */ bgp_init (); diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index 8ae7f465..13f71de9 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -1096,8 +1096,5 @@ bgp_zebra_init (void) zclient->ipv6_route_delete = zebra_read_ipv6; #endif /* HAVE_IPV6 */ - /* Interface related init. */ - if_init (); - bgp_nexthop_buf = stream_new(BGP_NEXTHOP_BUF_SIZE); } |