From 163d685192e3e472a0a556ae1b158ea2fca45027 Mon Sep 17 00:00:00 2001 From: Ryo Nakano Date: Fri, 1 Sep 2023 11:44:03 +0900 Subject: [PATCH] bgpd: Fix `show bgp all rpki notfound` The command "show bgp all rpki notfound" includes not only RPKI notfound routes but also RPKI valid and invalid routes in its results. Fix the code to display only RPKI notfound routes. Old output: ``` frr# show bgp all rpki notfound For address family: IPv4 Unicast BGP table version is 0, local router ID is 10.0.0.1, vrf id 0 Default local pref 100, local AS 64512 Status codes: s suppressed, d damped, h history, * valid, > best, = multipath, i internal, r RIB-failure, S Stale, R Removed Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found Network Next Hop Metric LocPrf Weight Path N x.x.x.0/18 a.a.a.a 100 0 64513 i V y.y.y.0/19 a.a.a.a 200 0 64513 i I z.z.z.0/16 a.a.a.a 10 0 64513 i Displayed 3 routes and 3 total paths ``` New output: ``` frr# show bgp all rpki notfound For address family: IPv4 Unicast BGP table version is 0, local router ID is 10.0.0.1, vrf id 0 Default local pref 100, local AS 64512 Status codes: s suppressed, d damped, h history, * valid, > best, = multipath, i internal, r RIB-failure, S Stale, R Removed Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found Network Next Hop Metric LocPrf Weight Path N x.x.x.0/18 a.a.a.a 100 0 64513 i Displayed 1 routes and 3 total paths ``` Signed-off-by: Ryo Nakano (cherry picked from commit 65d6b56a063006c38ee695e711be3b3e78fb1745) --- bgpd/bgp_route.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index f170b3ef81..c74981c298 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -12958,6 +12958,8 @@ DEFPY(show_ip_bgp, show_ip_bgp_cmd, rpki_target_state = RPKI_VALID; else if (argv_find(argv, argc, "invalid", &idx)) rpki_target_state = RPKI_INVALID; + else if (argv_find(argv, argc, "notfound", &idx)) + rpki_target_state = RPKI_NOTFOUND; } /* Display prefixes with matching version numbers */ -- 2.39.5