From 198ef12aefac2ccc746064c39de5c61cd4dcd68f Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Thu, 14 Oct 2021 21:06:38 +0300 Subject: [PATCH] ospf6d: don't use if_lookup_by_name_all_vrf if_lookup_by_name_all_vrf doesn't work correctly with netns VRF backend as the same index may be used in multiple netns simultaneously. Use the appropriate VRF when looking for the interface. Signed-off-by: Igor Ryzhov --- ospf6d/ospf6_asbr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c index cd2791fc48..3629942f17 100644 --- a/ospf6d/ospf6_asbr.c +++ b/ospf6d/ospf6_asbr.c @@ -2042,10 +2042,12 @@ ospf6_routemap_rule_match_interface(void *rule, const struct prefix *prefix, void *object) { struct interface *ifp; + struct ospf6_route *route; struct ospf6_external_info *ei; - ei = ((struct ospf6_route *)object)->route_option; - ifp = if_lookup_by_name_all_vrf((char *)rule); + route = object; + ei = route->route_option; + ifp = if_lookup_by_name((char *)rule, route->ospf6->vrf_id); if (ifp != NULL && ei->ifindex == ifp->ifindex) return RMAP_MATCH;