mirror of
https://git.proxmox.com/git/mirror_frr
synced 2026-01-04 18:27:53 +00:00
zebra: Cleanup error handling of nexthop vrf and vrf
The error handling of the nexthop vrf and the vrf for what was specified on the cli was not as clean as it should have been. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
e6149ab4b8
commit
e65dfe7e56
@ -475,20 +475,21 @@ DEFPY(ip_route_address_interface,
|
||||
ifname = NULL;
|
||||
}
|
||||
|
||||
if (nexthop_vrf) {
|
||||
nh_zvrf = zebra_vrf_lookup_by_name(nexthop_vrf);
|
||||
if (!nh_zvrf) {
|
||||
vty_out(vty, "%% nexthop vrf %s is not defined\n",
|
||||
nexthop_vrf);
|
||||
return CMD_WARNING_CONFIG_FAILED;
|
||||
}
|
||||
} else
|
||||
nh_zvrf = zebra_vrf_lookup_by_name(vrf);
|
||||
|
||||
zvrf = zebra_vrf_lookup_by_name(vrf);
|
||||
if (!zvrf) {
|
||||
vty_out(vty, "%% vrf %s is not defined\n",
|
||||
vrf);
|
||||
return CMD_WARNING_CONFIG_FAILED;
|
||||
}
|
||||
|
||||
if (nexthop_vrf)
|
||||
nh_zvrf = zebra_vrf_lookup_by_name(nexthop_vrf);
|
||||
else
|
||||
nh_zvrf = zvrf;
|
||||
|
||||
if (!nh_zvrf) {
|
||||
vty_out(vty, "%% nexthop vrf %s is not defined\n",
|
||||
vrf);
|
||||
nexthop_vrf);
|
||||
return CMD_WARNING_CONFIG_FAILED;
|
||||
}
|
||||
|
||||
@ -582,23 +583,25 @@ DEFPY(ip_route,
|
||||
ifname = NULL;
|
||||
}
|
||||
|
||||
if (nexthop_vrf) {
|
||||
nh_zvrf = zebra_vrf_lookup_by_name(nexthop_vrf);
|
||||
if (!nh_zvrf) {
|
||||
vty_out(vty, "%% nexthop vrf %s is not defined\n",
|
||||
nexthop_vrf);
|
||||
return CMD_WARNING_CONFIG_FAILED;
|
||||
}
|
||||
} else
|
||||
nh_zvrf = zebra_vrf_lookup_by_name(vrf);
|
||||
|
||||
zvrf = zebra_vrf_lookup_by_name(vrf);
|
||||
if (!nh_zvrf) {
|
||||
vty_out(vty, "%% nexthop vrf %s is not defined\n",
|
||||
if (!zvrf) {
|
||||
vty_out(vty, "%% vrf %s is not defined\n",
|
||||
vrf);
|
||||
return CMD_WARNING_CONFIG_FAILED;
|
||||
}
|
||||
|
||||
if (nexthop_vrf)
|
||||
nh_zvrf = zebra_vrf_lookup_by_name(nexthop_vrf);
|
||||
else
|
||||
nh_zvrf = zvrf;
|
||||
|
||||
if (!nh_zvrf) {
|
||||
vty_out(vty, "%% nexthop vrf %s is not defined\n",
|
||||
nexthop_vrf);
|
||||
return CMD_WARNING_CONFIG_FAILED;
|
||||
}
|
||||
|
||||
|
||||
return zebra_static_route_leak(vty, zvrf, nh_zvrf,
|
||||
AFI_IP, SAFI_UNICAST, no, prefix,
|
||||
mask_str, NULL, gate_str, ifname, flag,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user