Skip to content

Commit

Permalink
Merge pull request FRRouting#17670 from pguibert6WIND/rpki_json_missing
Browse files Browse the repository at this point in the history
bgpd: add rpki json attributes to bgp path
  • Loading branch information
Jafaral authored Dec 20, 2024
2 parents 956143a + 2f3fb01 commit 2f0f5d9
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 2f0f5d9

Please sign in to comment.