zebra: mrib: Include BGP routes in RPF lookups
The rib_match_ipv4() function was previously used only for iBGP
recursive nexthop lookups, which ignore eBGP routes. This is not
desirable for PIM RPF lookups, which may well use an eBGP route.
Cc: Everton Marques <everton.marques@gmail.com>
Cc: Balaji G <balajig81@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 469c10b..f4a9155 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -721,11 +721,11 @@
struct rib *
rib_match_ipv4 (struct in_addr addr)
{
- return rib_match_ipv4_safi (addr, SAFI_UNICAST);
+ return rib_match_ipv4_safi (addr, SAFI_UNICAST, 1);
}
struct rib *
-rib_match_ipv4_safi (struct in_addr addr, safi_t safi)
+rib_match_ipv4_safi (struct in_addr addr, safi_t safi, int skip_bgp)
{
struct route_table *table;
struct route_node *rn;
@@ -755,8 +755,7 @@
/* If there is no selected route or matched route is EGP, go up
tree. */
- if (! match
- || match->type == ZEBRA_ROUTE_BGP)
+ if (!match || (skip_bgp && (match->type == ZEBRA_ROUTE_BGP)))
{
do {
rn = rn->parent;