From 75688c44d98af271ca4eb4f3133ede9e7ae709bb Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Tue, 24 Jan 2017 16:17:30 +0100 Subject: [PATCH] bgpd: fix show ip bgp ipv4|ipv6 vpn command The fix consists in setting the correct safi value. Signed-off-by: Philippe Guibert --- bgpd/bgp_route.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) 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--; -- 2.39.5