From 01bb6d57988fc7e44b4a8202ef9e140ca0d184d3 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 27 Apr 2016 14:30:45 -0400 Subject: [PATCH] zebra: Refactor zebra_vrf_static_table We were passing in the vrf_id pass in the zvrf instead. Signed-off-by: donald Sharp Reviewed-by: Don Slice --- zebra/zebra_rib.c | 6 ++++-- zebra/zebra_vrf.c | 4 +--- zebra/zebra_vrf.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index cef89bf021..b41ebaab02 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -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; diff --git a/zebra/zebra_vrf.c b/zebra/zebra_vrf.c index c268fcbcb7..5624435f88 100644 --- a/zebra/zebra_vrf.c +++ b/zebra/zebra_vrf.c @@ -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; diff --git a/zebra/zebra_vrf.h b/zebra/zebra_vrf.h index e8bc201a63..36889e089d 100644 --- a/zebra/zebra_vrf.h +++ b/zebra/zebra_vrf.h @@ -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); -- 2.39.5