From 06432d4e4f41cf9a516a92987066f2b662d80fce Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Thu, 5 Jul 2018 10:02:57 +0200 Subject: [PATCH] zebra: pbr rule lookup index adaptation for vrf netns the interface lookup based on ifindex in the case the target vrf is unknown is using the generic vrf api. Like that, in the case of vrf based netns, the search across different netns other than the default one are not searched. Signed-off-by: Philippe Guibert --- zebra/zapi_msg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index 08666bf37d..c3d6783a31 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -2820,7 +2820,9 @@ static inline void zread_rule(ZAPI_HANDLER_ARGS) STREAM_GETL(s, ifindex); if (ifindex) { - zpr.ifp = if_lookup_by_index(ifindex, VRF_UNKNOWN); + zpr.ifp = if_lookup_by_index_per_ns( + zvrf->zns, + ifindex); if (!zpr.ifp) { zlog_debug("Failed to lookup ifindex: %u", ifindex); -- 2.39.5