Skip to content

Commit

Permalink
bgpd: add rpki json attributes to bgp path
Browse files Browse the repository at this point in the history
Add missing json attribute to BGP path.

Fixes: 82c298b ("bgpd: Show RPKI short state in `show bgp <afi> <safi>`")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
  • Loading branch information
pguibert6WIND committed Dec 19, 2024
1 parent 4a0e8ed commit 2f3fb01
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -9361,9 +9361,18 @@ static void route_vty_short_status_out(struct vty *vty,
const struct prefix *p,
json_object *json_path)
{
enum rpki_states rpki_state = RPKI_NOT_BEING_USED;
enum rpki_states rpki_state;

/* RPKI validation state */
rpki_state = hook_call(bgp_rpki_prefix_status, path->peer, path->attr, p);

if (json_path) {
if (rpki_state == RPKI_VALID)
json_object_boolean_true_add(json_path, "rpkiValid");
else if (rpki_state == RPKI_INVALID)
json_object_boolean_true_add(json_path, "rpkiInvalid");
else if (rpki_state == RPKI_NOTFOUND)
json_object_boolean_true_add(json_path, "rpkiNotFound");

/* Route status display. */
if (CHECK_FLAG(path->flags, BGP_PATH_REMOVED))
Expand Down Expand Up @@ -9411,10 +9420,6 @@ static void route_vty_short_status_out(struct vty *vty,
return;
}

/* RPKI validation state */
rpki_state =
hook_call(bgp_rpki_prefix_status, path->peer, path->attr, p);

if (rpki_state == RPKI_VALID)
vty_out(vty, "V");
else if (rpki_state == RPKI_INVALID)
Expand Down

0 comments on commit 2f3fb01

Please sign in to comment.