zebra: let the route-map rule "match interface" work for VRFs
Introduce a new "struct nexthop_vrfid" to specify a nexthop together
with the VRF ID it belongs to.
Thus in route_match_interface(), we can lookup the interface from
the correct VRF.
Signed-off-by: Feng Lu <lu.feng@6wind.com>
Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Vincent JARDIN <vincent.jardin@6wind.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
diff --git a/zebra/rib.h b/zebra/rib.h
index 2d8805a..84cd3da 100644
--- a/zebra/rib.h
+++ b/zebra/rib.h
@@ -317,6 +317,14 @@
: ((tnexthop) = (nexthop)->next)) \
: (((recursing) = 0),((tnexthop) = (tnexthop)->next)))
+/* Structure holding nexthop & VRF identifier,
+ * used for applying the route-map. */
+struct nexthop_vrfid
+{
+ struct nexthop *nexthop;
+ vrf_id_t vrf_id;
+};
+
/* Routing table instance. */
struct zebra_vrf
{