]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Fix `show bgp all rpki notfound` 14334/head
authorRyo Nakano <ryo.z.nakano@gmail.com>
Fri, 1 Sep 2023 02:44:03 +0000 (11:44 +0900)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Fri, 1 Sep 2023 13:39:56 +0000 (13:39 +0000)
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 <ryo.z.nakano@gmail.com>
(cherry picked from commit 65d6b56a063006c38ee695e711be3b3e78fb1745)

bgpd/bgp_route.c

index f170b3ef8195bf0be5f0699bb6121bf27371fc6f..c74981c298af9ba1052252340bdb7de24f19d8ec 100644 (file)
@@ -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 */