From: Philippe Guibert Date: Tue, 24 Jan 2017 15:17:30 +0000 (+0100) Subject: bgpd: fix show ip bgp ipv4|ipv6 vpn command X-Git-Tag: frr-3.0-branchpoint~72 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=75688c44d98af271ca4eb4f3133ede9e7ae709bb;p=matthieu%2Ffrr.git bgpd: fix show ip bgp ipv4|ipv6 vpn command The fix consists in setting the correct safi value. Signed-off-by: Philippe Guibert --- diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index f9cdc1a0db..eea0f86b34 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -7882,15 +7882,9 @@ DEFUN (show_ip_bgp_ipv4, afi = strmatch(argv[idx]->text, "ipv6") ? AFI_IP6 : AFI_IP; if (argv_find (argv, argc, "unicast", &idx) || argv_find (argv, argc, "multicast", &idx)) safi = bgp_vty_safi_from_arg (argv[idx]->text); + else if (argv_find (argv, argc, "encap", &idx) || argv_find (argv, argc, "vpn", &idx)) + safi = strmatch (argv[idx]->text, "encap") ? SAFI_ENCAP : SAFI_MPLS_VPN; } - else if (argv_find (argv, argc, "encap", &idx) || argv_find (argv, argc, "vpnv4", &idx)) - { - afi = AFI_IP; - safi = strmatch (argv[idx]->text, "encap") ? SAFI_ENCAP : SAFI_MPLS_VPN; - // advance idx if necessary - argv_find (argv, argc, "unicast", &idx); - } - int uj = use_json (argc, argv); if (uj) argc--;