zebra: Refactor zebra_vrf_static_table

We were passing in the vrf_id pass in the zvrf
instead.

Signed-off-by: donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2016-04-27 14:30:45 -04:00
parent e21674bd88
commit 01bb6d5798
3 changed files with 6 additions and 6 deletions

View File

@ -3121,9 +3121,10 @@ static_delete_ipv4 (struct prefix *p, struct in_addr *gate, unsigned int ifindex
struct route_node *rn;
struct static_route *si;
struct route_table *stable;
struct zebra_vrf *zvrf = vrf_info_lookup (vrf_id);
/* Lookup table. */
stable = zebra_vrf_static_table (AFI_IP, SAFI_UNICAST, vrf_id);
stable = zebra_vrf_static_table (AFI_IP, SAFI_UNICAST, zvrf);
if (! stable)
return -1;
@ -3640,9 +3641,10 @@ static_delete_ipv6 (struct prefix *p, u_char type, struct in6_addr *gate,
struct route_node *rn;
struct static_route *si;
struct route_table *stable;
struct zebra_vrf *zvrf = vrf_info_lookup (vrf_id);
/* Lookup table. */
stable = zebra_vrf_static_table (AFI_IP6, SAFI_UNICAST, vrf_id);
stable = zebra_vrf_static_table (AFI_IP6, SAFI_UNICAST, zvrf);
if (! stable)
return -1;

View File

@ -244,10 +244,8 @@ zebra_vrf_table (afi_t afi, safi_t safi, vrf_id_t vrf_id)
/* Lookup the static routing table in a VRF. */
struct route_table *
zebra_vrf_static_table (afi_t afi, safi_t safi, vrf_id_t vrf_id)
zebra_vrf_static_table (afi_t afi, safi_t safi, struct zebra_vrf *zvrf)
{
struct zebra_vrf *zvrf = vrf_info_lookup (vrf_id);
if (!zvrf)
return NULL;

View File

@ -84,7 +84,7 @@ extern void zebra_vrf_update_all (struct zserv *client);
extern struct zebra_vrf *zebra_vrf_lookup (vrf_id_t vrf_id);
extern struct zebra_vrf *zebra_vrf_alloc (vrf_id_t, const char *);
extern struct route_table *zebra_vrf_table (afi_t, safi_t, vrf_id_t);
extern struct route_table *zebra_vrf_static_table (afi_t, safi_t, vrf_id_t);
extern struct route_table *zebra_vrf_static_table (afi_t, safi_t, struct zebra_vrf *zvrf);
extern struct route_table *zebra_vrf_other_route_table (afi_t afi, u_int32_t table_id,
vrf_id_t vrf_id);
extern void zebra_vrf_init (void);