From: Donald Sharp Date: Tue, 30 Jan 2018 05:15:45 +0000 (-0500) Subject: zebra: Fix v6 nexthop-vrf and nexthop confusion X-Git-Tag: frr-4.0-dev~11^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=refs%2Fpull%2F1693%2Fhead;p=mirror%2Ffrr.git zebra: Fix v6 nexthop-vrf and nexthop confusion The v6 code had the same issue with how it handled nexthop-vrf and nexthop when it was entered on the same line. This fixes that issue. Signed-off-by: Donald Sharp --- diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index f0be862221..62869b7eec 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -2013,17 +2013,21 @@ DEFPY(ipv6_route_address_interface, struct zebra_vrf *zvrf; struct zebra_vrf *nh_zvrf; - nh_zvrf = zebra_vrf_lookup_by_name(nexthop_vrf); - if (!nh_zvrf) { - vty_out(vty, "%% nexthop vrf %s is not defined\n", - nexthop_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; } - zvrf = zebra_vrf_lookup_by_name(vrf); + 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; } @@ -2104,17 +2108,21 @@ DEFPY(ipv6_route, struct zebra_vrf *zvrf; struct zebra_vrf *nh_zvrf; - nh_zvrf = zebra_vrf_lookup_by_name(nexthop_vrf); - if (!nh_zvrf) { - vty_out(vty, "%% nexthop vrf %s is not defined\n", - nexthop_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; } - zvrf = zebra_vrf_lookup_by_name(vrf); + 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; }