mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-06-29 16:53:36 +00:00
Merge pull request #6666 from donaldsharp/pbr_interface
pbrd: Be a bit more lenient with `set nexthop A.B.C.D <intf>`
This commit is contained in:
commit
807c31d582
@ -312,7 +312,7 @@ DEFPY(pbr_map_nexthop, pbr_map_nexthop_cmd,
|
|||||||
vrf = vrf_lookup_by_id(VRF_DEFAULT);
|
vrf = vrf_lookup_by_id(VRF_DEFAULT);
|
||||||
|
|
||||||
if (!vrf) {
|
if (!vrf) {
|
||||||
vty_out(vty, "Specified: %s is non-existent\n", vrf_name);
|
vty_out(vty, "Specified VRF: %s is non-existent\n", vrf_name);
|
||||||
return CMD_WARNING_CONFIG_FAILED;
|
return CMD_WARNING_CONFIG_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -320,13 +320,24 @@ DEFPY(pbr_map_nexthop, pbr_map_nexthop_cmd,
|
|||||||
nhop.vrf_id = vrf->vrf_id;
|
nhop.vrf_id = vrf->vrf_id;
|
||||||
|
|
||||||
if (intf) {
|
if (intf) {
|
||||||
nhop.ifindex = ifname2ifindex(intf, vrf->vrf_id);
|
struct interface *ifp;
|
||||||
if (nhop.ifindex == IFINDEX_INTERNAL) {
|
|
||||||
vty_out(vty,
|
ifp = if_lookup_by_name_all_vrf(intf);
|
||||||
"Specified Intf %s does not exist in vrf: %s\n",
|
if (!ifp) {
|
||||||
intf, vrf->name);
|
vty_out(vty, "Specified Intf %s does not exist\n",
|
||||||
|
intf);
|
||||||
return CMD_WARNING_CONFIG_FAILED;
|
return CMD_WARNING_CONFIG_FAILED;
|
||||||
}
|
}
|
||||||
|
if (ifp->vrf_id != vrf->vrf_id) {
|
||||||
|
struct vrf *actual;
|
||||||
|
|
||||||
|
actual = vrf_lookup_by_id(ifp->vrf_id);
|
||||||
|
vty_out(vty,
|
||||||
|
"Specified Intf %s is not in vrf %s but is in vrf %s, using actual vrf\n",
|
||||||
|
ifp->name, vrf->name, actual->name);
|
||||||
|
}
|
||||||
|
nhop.ifindex = ifp->ifindex;
|
||||||
|
nhop.vrf_id = ifp->vrf_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (addr) {
|
if (addr) {
|
||||||
|
Loading…
Reference in New Issue
Block a user