diff options
| author | Feng Lu <lu.feng@6wind.com> | 2015-05-22 11:40:07 +0200 |
|---|---|---|
| committer | Vipin Kumar <vipin@cumulusnetworks.com> | 2015-10-30 00:19:15 -0700 |
| commit | c6ffe64543f9a5b8d26ce9274911882dda07065b (patch) | |
| tree | 9c88d7e9d199609a0131519a01fa26a6212c1201 /zebra/zserv.c | |
| parent | 8f527c5e7e6888a7fced25928ea22899259ab49f (diff) | |
zebra: maintain the router-id per VRF
A router may need different identifier among the VRFs. So move the
maintenance of router-id per VRF.
* rib.h:
Move the previous global variables in router-id.c into the
"struct zebra_vrf":
- struct list _rid_all_sorted_list/*rid_all_sorted_list
- struct list _rid_lo_sorted_list/*rid_lo_sorted_list
- struct prefix rid_user_assigned
* router-id.c/router-id.h:
A new parameter "vrf_id" is added to all the router-id APIs.
Their operations are done only within the specified VRF.
A new command "router-id A.B.C.D vrf N" is added to allow
manual router-id for any VRF.
The old router_id_init() function is splitted into two:
- router_id_cmd_init(): it only installs the commands
- router_id_init(): this new one initializes the variables for
a specified VRF
* zebra_rib.c: Add new functions zebra_vrf_get/lookup() called
from router-id.c.
* main.c: Replace router_id_init() with router_id_cmd_init() and
call the new router_id_init() in zebra_vrf_new().
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>
Conflicts:
zebra/rib.h
Conflicts:
zebra/rib.h
zebra/router-id.c
zebra/zserv.h
Diffstat (limited to 'zebra/zserv.c')
| -rw-r--r-- | zebra/zserv.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/zebra/zserv.c b/zebra/zserv.c index 052c797f8b..7a5700210f 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -948,7 +948,8 @@ zsend_ipv4_import_lookup (struct zserv *client, struct prefix_ipv4 *p) /* Router-id is updated. Send ZEBRA_ROUTER_ID_ADD to client. */ int -zsend_router_id_update (struct zserv *client, struct prefix *p) +zsend_router_id_update (struct zserv *client, struct prefix *p, + vrf_id_t vrf_id) { struct stream *s; int blen; @@ -1623,9 +1624,9 @@ zread_router_id_add (struct zserv *client, u_short length) /* Router-id information is needed. */ client->ridinfo = 1; - router_id_get (&p); + router_id_get (&p, VRF_DEFAULT); - return zsend_router_id_update (client,&p); + return zsend_router_id_update (client, &p, VRF_DEFAULT); } /* Unregister zebra server router-id information. */ |
