]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Refactor zebra_vrf_static_table
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 27 Apr 2016 18:30:45 +0000 (14:30 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 2 May 2016 17:16:45 +0000 (13:16 -0400)
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>
zebra/zebra_rib.c
zebra/zebra_vrf.c
zebra/zebra_vrf.h

index cef89bf0210afd8475d1bface162d340de915543..b41ebaab0200a0cdde2b538d8c073dbf6ef4540f 100644 (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;
 
index c268fcbcb79e85a99a8fe0ad18b96578a3c0427a..5624435f8831fd208a722d1d49c7016fe823e195 100644 (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;
 
index e8bc201a634427cc749060d1558d04fb9a6c4b1f..36889e089de397a9b3fd1c7cac146cb6d346dc78 100644 (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);