Skip to content

Commit

Permalink
bgpd: Use gracefulRestart JSON field
Browse files Browse the repository at this point in the history
Deprecate gracefulRestartCapability which is inconsistent with an existing
format if advertised and received are printed.

Signed-off-by: Donatas Abraitis <[email protected]>
  • Loading branch information
ton31337 committed Nov 25, 2024
1 parent 0a85b1b commit ee5893f
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions bgpd/bgp_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -14897,22 +14897,31 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json,
if (CHECK_FLAG(p->cap, PEER_CAP_RESTART_RCV) ||
CHECK_FLAG(p->cap, PEER_CAP_RESTART_ADV)) {
if (CHECK_FLAG(p->cap, PEER_CAP_RESTART_ADV) &&
CHECK_FLAG(p->cap, PEER_CAP_RESTART_RCV))
CHECK_FLAG(p->cap, PEER_CAP_RESTART_RCV)) {
json_object_string_add(
json_cap, "gracefulRestart",
"advertisedAndReceived");
else if (CHECK_FLAG(p->cap,
PEER_CAP_RESTART_ADV))
} else if (CHECK_FLAG(p->cap, PEER_CAP_RESTART_ADV)) {
json_object_string_add(json_cap, "gracefulRestart",
"advertised");
#if CONFDATE > 20250525
CPP_NOTICE("Remove `gracefulRestartCapability` JSON field")
#endif
json_object_string_add(
json_cap,
"gracefulRestartCapability",
"advertised");
else if (CHECK_FLAG(p->cap,
PEER_CAP_RESTART_RCV))
} else if (CHECK_FLAG(p->cap, PEER_CAP_RESTART_RCV)) {
json_object_string_add(json_cap, "gracefulRestart",
"received");
#if CONFDATE > 20250525
CPP_NOTICE("Remove `gracefulRestartCapability` JSON field")
#endif
json_object_string_add(
json_cap,
"gracefulRestartCapability",
"received");
}

if (CHECK_FLAG(p->cap, PEER_CAP_RESTART_RCV)) {
int restart_af_count = 0;
Expand Down

0 comments on commit ee5893f

Please sign in to comment.