Skip to content

Commit 2165b33

Browse files
vivek-cumulusPdoijode
authored andcommitted
bgpd: Refine OPEN debug logs for graceful restart
This also fixes Rx F-bit log which was incorrect. Signed-off-by: Vivek Venkatraman <[email protected]>
1 parent 1960c35 commit 2165b33

File tree

1 file changed

+17
-22
lines changed

1 file changed

+17
-22
lines changed

bgpd/bgp_open.c

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -519,20 +519,17 @@ static int bgp_capability_restart(struct peer *peer,
519519
UNSET_FLAG(restart_flag_time, 0xF000);
520520
peer->v_gr_restart = restart_flag_time;
521521

522-
if (bgp_debug_neighbor_events(peer)) {
523-
zlog_debug(
524-
"%s Peer has%srestarted. Restart Time: %d, N-bit set: %s",
525-
peer->host,
526-
CHECK_FLAG(peer->cap,
527-
PEER_CAP_GRACEFUL_RESTART_R_BIT_RCV)
528-
? " "
529-
: " not ",
530-
peer->v_gr_restart,
531-
CHECK_FLAG(peer->cap,
532-
PEER_CAP_GRACEFUL_RESTART_N_BIT_RCV)
533-
? "yes"
534-
: "no");
535-
}
522+
if (bgp_debug_neighbor_events(peer))
523+
zlog_debug("%s OPEN has GR capability, Restart time %d R-bit %s N-bit %s",
524+
peer->host, peer->v_gr_restart,
525+
CHECK_FLAG(peer->cap,
526+
PEER_CAP_GRACEFUL_RESTART_R_BIT_RCV)
527+
? "SET"
528+
: "NOT-SET",
529+
CHECK_FLAG(peer->cap,
530+
PEER_CAP_GRACEFUL_RESTART_N_BIT_RCV)
531+
? "SET"
532+
: "NOT-SET");
536533

537534
while (stream_get_getp(s) + 4 <= end) {
538535
afi_t afi;
@@ -556,14 +553,12 @@ static int bgp_capability_restart(struct peer *peer,
556553
iana_safi2str(pkt_safi));
557554
} else {
558555
if (bgp_debug_neighbor_events(peer))
559-
zlog_debug(
560-
"%s Address family %s is%spreserved",
561-
peer->host, get_afi_safi_str(afi, safi, false),
562-
CHECK_FLAG(
563-
peer->af_cap[afi][safi],
564-
PEER_CAP_RESTART_AF_PRESERVE_RCV)
565-
? " "
566-
: " not ");
556+
zlog_debug("... F-bit %s for %s",
557+
CHECK_FLAG(peer->af_cap[afi][safi],
558+
PEER_CAP_RESTART_AF_PRESERVE_RCV)
559+
? "SET"
560+
: "NOT-SET",
561+
get_afi_safi_str(afi, safi, false));
567562

568563
SET_FLAG(peer->af_cap[afi][safi],
569564
PEER_CAP_RESTART_AF_RCV);

0 commit comments

Comments
 (0)