]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: add rib_match_ipv4_safi()
authorEverton Marques <everton.marques@gmail.com>
Mon, 22 Sep 2014 22:35:51 +0000 (19:35 -0300)
committerDonald Sharp <sharpd@cumulusnetwroks.com>
Thu, 26 May 2016 00:38:31 +0000 (20:38 -0400)
This is the same as rib_lookup_ipv4(), without the SAFI hardcoded.

Cc: Balaji G <balajig81@gmail.com>
Cc: Everton Marques <everton.marques@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
zebra/rib.h
zebra/zebra_rib.c
zebra/zserv.c

index 95c6a506c8aba8d02d76f8829457f5c091ab7f30..0d5c902eb3155efb58788de828f8b6d8840873d8 100644 (file)
@@ -369,7 +369,7 @@ extern int rib_delete_ipv4 (int type, u_short instance, int flags, struct prefix
                            struct in_addr *gate, unsigned int ifindex, 
                            vrf_id_t, u_int32_t, safi_t safi);
 
-extern struct rib *rib_match_ipv4 (struct in_addr, vrf_id_t);
+extern struct rib *rib_match_ipv4 (struct in_addr, safi_t safi, vrf_id_t);
 
 extern struct rib *rib_lookup_ipv4 (struct prefix_ipv4 *, vrf_id_t);
 
index 7c4df351f4cec52ba8fae9b10d41b1991848cfa5..6c6db170e37cce9ee62c006f45a99a13eea37d4d 100644 (file)
@@ -733,7 +733,7 @@ nexthop_active_ipv6 (struct rib *rib, struct nexthop *nexthop, int set,
 }
 
 struct rib *
-rib_match_ipv4 (struct in_addr addr, vrf_id_t vrf_id)
+rib_match_ipv4 (struct in_addr addr, safi_t safi, vrf_id_t vrf_id)
 {
   struct prefix_ipv4 p;
   struct route_table *table;
@@ -743,7 +743,7 @@ rib_match_ipv4 (struct in_addr addr, vrf_id_t vrf_id)
   int recursing;
 
   /* Lookup table.  */
-  table = zebra_vrf_table (AFI_IP, SAFI_UNICAST, vrf_id);
+  table = zebra_vrf_table (AFI_IP, safi, vrf_id);
   if (! table)
     return 0;
 
index d6de0792e184302ac9f2def978d54c85221f1472..6370508da0f886cf42dcfd481722cf8b127c4cb6 100644 (file)
@@ -788,7 +788,7 @@ zsend_ipv4_nexthop_lookup (struct zserv *client, struct in_addr addr,
   struct nexthop *nexthop;
 
   /* Lookup nexthop. */
-  rib = rib_match_ipv4 (addr, vrf_id);
+  rib = rib_match_ipv4 (addr, SAFI_UNICAST, vrf_id);
 
   /* Get output stream. */
   s = client->obuf;