Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bgpd: last reset SNAFU #17881

Merged
merged 2 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions bgpd/bgp_fsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2163,6 +2163,9 @@ bgp_establish(struct peer_connection *connection)
peer->established++;
bgp_fsm_change_status(connection, Established);

if (peer->last_reset == PEER_DOWN_WAITING_OPEN)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really don't get this change. Can you help me understand why displaying this is not good? And if we don't want to use PEER_DOWN_WAITING_OPEN why keep it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the peer is created, "last reset" is displayed as "Waiting for OPEN" even when the connection is established which is something a "confusing part" (because it wasn't reset actually).

peer->last_reset = 0;

/* bgp log-neighbor-changes of neighbor Up */
if (CHECK_FLAG(peer->bgp->flags, BGP_FLAG_LOG_NEIGHBOR_CHANGES)) {
struct vrf *vrf = vrf_lookup_by_id(peer->bgp->vrf_id);
Expand Down
5 changes: 4 additions & 1 deletion bgpd/bgpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2026,8 +2026,11 @@ struct peer *peer_create(union sockunion *su, const char *conf_if,
if (bgp->autoshutdown)
peer_flag_set(peer, PEER_FLAG_SHUTDOWN);
/* Set up peer's events and timers. */
else if (!active && peer_active(peer->connection))
else if (!active && peer_active(peer->connection)) {
if (peer->last_reset == PEER_DOWN_NOAFI_ACTIVATED)
peer->last_reset = 0;
bgp_timer_set(peer->connection);
}

bgp_peer_gr_flags_update(peer);
BGP_GR_ROUTER_DETECT_AND_SEND_CAPABILITY_TO_ZEBRA(bgp, bgp->peer);
Expand Down
Loading