diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2024-12-18 18:27:55 +0100 |
|---|---|---|
| committer | Philippe Guibert <philippe.guibert@6wind.com> | 2024-12-19 17:14:36 +0100 |
| commit | 2f3fb0128ee40646a4ea99a8a165cb28c55822cc (patch) | |
| tree | 2ac8cc36c61debd826366264744ecb55eb704b37 | |
| parent | 4a0e8ed8dab49f342e9b0de4b7463568abdf626f (diff) | |
bgpd: add rpki json attributes to bgp path
Add missing json attribute to BGP path.
Fixes: 82c298be7354 ("bgpd: Show RPKI short state in `show bgp <afi> <safi>`")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
| -rw-r--r-- | bgpd/bgp_route.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 7c3dd234a2..e142d96618 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -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)) @@ -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) |
