summaryrefslogtreecommitdiffstats
path: root/lib/nexthop.c
diff options
context:
space:
mode:
authorKantesh Mundaragi <kmundaragi@vmware.com>2021-08-24 16:53:29 +0200
committerIqra Siddiqui <imujeebsiddi@vmware.com>2021-09-07 10:50:06 +0200
commit0789eb69e5b4b1d0b9040cea79cd047ce77b9406 (patch)
treea4ad88bd20b7c777fb6c974cee26ea7d9343878e /lib/nexthop.c
parentMerge pull request #9557 from idryzhov/bgp-view-cleanup (diff)
downloadfrr-0789eb69e5b4b1d0b9040cea79cd047ce77b9406.tar.xz
frr-0789eb69e5b4b1d0b9040cea79cd047ce77b9406.zip
bgpd: VRF-Lite fix nexthop type
Description: Change is intended for fixing the following issues related to vrf route leaking: Routes with special nexthops i.e. blackhole/sink routes when imported, are not programmed into the FIB and corresponding nexthop is set as 'inactive', nexthop interface as 'unknown'. While importing/leaking routes between VRFs, in case of special nexthop(ipv4/ipv6) once bgp announces route(s) to zebra, nexthop type is incorrectly set as NEXTHOP_TYPE_IPV6_IFINDEX/NEXTHOP_TYPE_IFINDEX i.e. directly connected even though we are not able to resolve through an interface. This leads to nexthop_active_check marking nexthop !NEXTHOP_FLAG_ACTIVE. Unable to find the active nexthop(s), route is not programmed into the FIB. Whenever BGP leaks routes, set the correct nexthop type, so that route gets resolved and correctly programmed into the FIB, in the imported vrf. Co-authored-by: Kantesh Mundaragi <kmundaragi@vmware.com> Signed-off-by: Iqra Siddiqui <imujeebsiddi@vmware.com>
Diffstat (limited to 'lib/nexthop.c')
-rw-r--r--lib/nexthop.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/nexthop.c b/lib/nexthop.c
index 23e3a2b73..98409c76c 100644
--- a/lib/nexthop.c
+++ b/lib/nexthop.c
@@ -519,12 +519,13 @@ struct nexthop *nexthop_from_ipv6_ifindex(const struct in6_addr *ipv6,
return nexthop;
}
-struct nexthop *nexthop_from_blackhole(enum blackhole_type bh_type)
+struct nexthop *nexthop_from_blackhole(enum blackhole_type bh_type,
+ vrf_id_t nh_vrf_id)
{
struct nexthop *nexthop;
nexthop = nexthop_new();
- nexthop->vrf_id = VRF_DEFAULT;
+ nexthop->vrf_id = nh_vrf_id;
nexthop->type = NEXTHOP_TYPE_BLACKHOLE;
nexthop->bh_type = bh_type;