Merge pull request #5807 from ton31337/fix/do_not_show_failed_if_shutdown

bgpd: Show the real reason why the peer is failed
This commit is contained in:
Donald Sharp 2020-02-17 09:29:28 -05:00 committed by GitHub
commit 4765870ee7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -578,7 +578,8 @@ const char *const peer_down_str[] = {"",
"Waiting for VRF to be initialized", "Waiting for VRF to be initialized",
"No AFI/SAFI activated for peer", "No AFI/SAFI activated for peer",
"AS Set config change", "AS Set config change",
"Waiting for peer OPEN"}; "Waiting for peer OPEN",
"Reached received prefix count"};
static int bgp_graceful_restart_timer_expire(struct thread *thread) static int bgp_graceful_restart_timer_expire(struct thread *thread)
{ {
@ -1512,6 +1513,10 @@ int bgp_start(struct peer *peer)
"%s [FSM] Trying to start suppressed peer" "%s [FSM] Trying to start suppressed peer"
" - this is never supposed to happen!", " - this is never supposed to happen!",
peer->host); peer->host);
if (CHECK_FLAG(peer->flags, PEER_FLAG_SHUTDOWN))
peer->last_reset = PEER_DOWN_USER_SHUTDOWN;
else if (CHECK_FLAG(peer->sflags, PEER_STATUS_PREFIX_OVERFLOW))
peer->last_reset = PEER_DOWN_PFX_COUNT;
return -1; return -1;
} }

View File

@ -1351,6 +1351,7 @@ struct peer {
#define PEER_DOWN_NOAFI_ACTIVATED 30 /* No AFI/SAFI activated for peer */ #define PEER_DOWN_NOAFI_ACTIVATED 30 /* No AFI/SAFI activated for peer */
#define PEER_DOWN_AS_SETS_REJECT 31 /* Reject routes with AS_SET */ #define PEER_DOWN_AS_SETS_REJECT 31 /* Reject routes with AS_SET */
#define PEER_DOWN_WAITING_OPEN 32 /* Waiting for open to succeed */ #define PEER_DOWN_WAITING_OPEN 32 /* Waiting for open to succeed */
#define PEER_DOWN_PFX_COUNT 33 /* Reached received prefix count */
/* /*
* Remember to update peer_down_str in bgp_fsm.c when you add * Remember to update peer_down_str in bgp_fsm.c when you add
* a new value to the last_reset reason * a new value to the last_reset reason