mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 09:30:30 +00:00
zebra: lookup the address in all VRFs when set the route-map rule "set src"
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
This commit is contained in:
parent
0032dd59cd
commit
f91386cb7d
@ -659,6 +659,7 @@ DEFUN (set_src,
|
|||||||
struct interface *pif = NULL;
|
struct interface *pif = NULL;
|
||||||
int family;
|
int family;
|
||||||
struct prefix p;
|
struct prefix p;
|
||||||
|
vrf_iter_t iter;
|
||||||
|
|
||||||
if (inet_pton(AF_INET, argv[0], &src.ipv4) != 1)
|
if (inet_pton(AF_INET, argv[0], &src.ipv4) != 1)
|
||||||
{
|
{
|
||||||
@ -685,10 +686,18 @@ DEFUN (set_src,
|
|||||||
return CMD_WARNING;
|
return CMD_WARNING;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (family == AF_INET)
|
for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
|
||||||
pif = if_lookup_exact_address ((void *)&src.ipv4, AF_INET);
|
{
|
||||||
else if (family == AF_INET6)
|
if (family == AF_INET)
|
||||||
pif = if_lookup_exact_address ((void *)&src.ipv6, AF_INET6);
|
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)
|
if (!pif)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user