]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: display rpki state in 'show bgp ipvX detail'
authorPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 20 Dec 2024 07:47:04 +0000 (08:47 +0100)
committerDmytro Shytyi <dmytro.shytyi@6wind.com>
Fri, 27 Dec 2024 14:32:35 +0000 (15:32 +0100)
The rpki current state was ignored when calling for the 'show bgp ipvX
detail' command. Handle the support for this, with json support too.

> "rpkiValidationState" : "valid",
> "rpkiValidationState" : "invalid",
> "rpkiValidationState" : "not used",
> "rpkiValidationState" : "not found",

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
bgpd/bgp_route.c

index bd2fda56fc203dc73f98e9533c0a38799f662a7a..7645c677346beb22e751bc7beb35ee7d5d83bd49 100644 (file)
@@ -11975,14 +11975,13 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, afi_t afi, safi_t sa
                                        continue;
                        }
 
-                       if (type == bgp_show_type_rpki) {
-                               if (dest_p->family == AF_INET
-                                   || dest_p->family == AF_INET6)
-                                       rpki_curr_state = hook_call(
-                                               bgp_rpki_prefix_status,
-                                               pi->peer, pi->attr, dest_p);
-                               if (rpki_target_state != RPKI_NOT_BEING_USED
-                                   && rpki_curr_state != rpki_target_state)
+                       if ((dest_p->family == AF_INET || dest_p->family == AF_INET6) &&
+                           (detail_routes || detail_json || type == bgp_show_type_rpki)) {
+                               rpki_curr_state = hook_call(bgp_rpki_prefix_status, pi->peer,
+                                                           pi->attr, dest_p);
+                               if (type == bgp_show_type_rpki &&
+                                   rpki_target_state != RPKI_NOT_BEING_USED &&
+                                   rpki_curr_state != rpki_target_state)
                                        continue;
                        }
 
@@ -12213,7 +12212,7 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, afi_t afi, safi_t sa
 
                                        route_vty_out_detail(vty, bgp, dest, dest_p, pi,
                                                             family2afi(dest_p->family), safi,
-                                                            RPKI_NOT_BEING_USED, json_paths, NULL);
+                                                            rpki_curr_state, json_paths, NULL);
                                } else {
                                        route_vty_out(vty, dest_p, pi, display,
                                                      safi, json_paths, wide);