When configuring the route-map rule "set src A.B.C.D", it checked
whether the source address exists on some interface.
Now it checks the source address throughout all VRFs.
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>
Conflicts:
zebra/zebra_routemap.c
Conflicts:
zebra/zebra_routemap.c
struct interface *pif = NULL;
int family;
struct prefix p;
+ vrf_iter_t iter;
if (inet_pton(AF_INET, argv[0], &src.ipv4) != 1)
{
return CMD_WARNING;
}
- if (family == AF_INET)
- pif = if_lookup_exact_address ((void *)&src.ipv4, AF_INET);
- else if (family == AF_INET6)
- pif = if_lookup_exact_address ((void *)&src.ipv6, AF_INET6);
+ for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
+ {
+ if (family == AF_INET)
+ pif = if_lookup_exact_address_vrf ((void *)&src.ipv4, AF_INET,
+ vrf_iter2id (iter));
+ else if (family == AF_INET6)
+ pif = if_lookup_exact_address_vrf ((void *)&src.ipv6, AF_INET6,
+ vrf_iter2id (iter));
+
+ if (pif != NULL)
+ break;
+ }
if (!pif)
{