diff options
author | Feng Lu <lu.feng@6wind.com> | 2015-05-22 11:40:10 +0200 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2015-06-02 07:48:34 +0200 |
commit | 49f76097fc191761db8482aa3bf6e6322c52c647 (patch) | |
tree | c7aef97b17e3dd41b19fa53535ecf1a9ca8aafb9 /zebra/main.c | |
parent | 267ceb2ce3adf4ce1357deb7ce48f151d6c58b92 (diff) | |
download | quagga-49f76097fc191761db8482aa3bf6e6322c52c647.tar.bz2 quagga-49f76097fc191761db8482aa3bf6e6322c52c647.tar.xz |
zebra: maintain RTADV per VRF
This moves the global variable "rtadv" into the "struct zebra_vrf",
so that RTADV feature can work per VRF.
* rtadv.c/rtadv.h:
Add a proper parameter to the functions so that the entity of the
"struct zebra_vrf" and interfaces can be obtained from the specified
VRF.
The old rtadv_init() is splitted into:
- rtadv_cmd_init(): it installs the RTADV commands; is called from
main();
- new rtadv_init(): it creates the socket; is called from
zebra_vrf_enable().
rtadv_terminate() is added to stop the threads, close the socket and
clear the counters. It is called from zebra_vrf_disable().
rtadv_make_socket() now calls vrf_socket() to create a socket in
the VRF.
* interface.h and rib.h: define the macro RTADV.
* main.c: according changes, refer to rtadv.c.
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 'zebra/main.c')
-rw-r--r-- | zebra/main.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/zebra/main.c b/zebra/main.c index 1e9757b6..08cc247d 100644 --- a/zebra/main.c +++ b/zebra/main.c @@ -229,6 +229,9 @@ zebra_vrf_enable (vrf_id_t vrf_id, void **info) assert (zvrf); +#ifdef RTADV + rtadv_init (zvrf); +#endif return 0; } @@ -253,6 +256,10 @@ zebra_vrf_disable (vrf_id_t vrf_id, void **info) if_down (ifp); } +#ifdef RTADV + rtadv_terminate (zvrf); +#endif + list_delete_all_node (zvrf->rid_all_sorted_list); list_delete_all_node (zvrf->rid_lo_sorted_list); @@ -394,7 +401,7 @@ main (int argc, char **argv) access_list_init (); prefix_list_init (); #ifdef RTADV - rtadv_init (); + rtadv_cmd_init (); #endif #ifdef HAVE_IRDP irdp_init(); |