summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgp_fsm.c7
-rw-r--r--bgpd/bgp_vty.c2
-rw-r--r--bgpd/bgpd.c6
-rw-r--r--bgpd/bgpd.h1
4 files changed, 13 insertions, 3 deletions
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c
index 4d395e374..1304a26ca 100644
--- a/bgpd/bgp_fsm.c
+++ b/bgpd/bgp_fsm.c
@@ -552,10 +552,11 @@ const char *peer_down_str[] = {"",
"Intf peering v6only config change",
"BFD down received",
"Interface down",
- "Neighbor address lost"
+ "Neighbor address lost",
"Waiting for NHT",
- "Waiting for Peer IPv6 Addr",
- "Waiting for VRF to be initialized"};
+ "Waiting for Peer IPv6 LLA",
+ "Waiting for VRF to be initialized",
+ "No AFI/SAFI activated for peer"};
static int bgp_graceful_restart_timer_expire(struct thread *thread)
{
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 7e7c0ea2d..17bc83ed2 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -7921,6 +7921,8 @@ static void bgp_show_peer_reset(struct vty * vty, struct peer *peer,
}
json_object_string_add(json_peer, "lastResetDueTo",
peer_down_str[(int)peer->last_reset]);
+ json_object_int_add(json_peer, "lastResetCode",
+ peer->last_reset);
} else {
if (peer->last_reset == PEER_DOWN_NOTIFY_SEND
|| peer->last_reset == PEER_DOWN_NOTIFY_RECEIVED) {
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index fed8cd4d8..5b31fbb3a 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -1582,6 +1582,12 @@ struct peer *peer_create(union sockunion *su, const char *conf_if,
}
active = peer_active(peer);
+ if (!active) {
+ if (peer->su.sa.sa_family == AF_UNSPEC)
+ peer->last_reset = PEER_DOWN_NBR_ADDR;
+ else
+ peer->last_reset = PEER_DOWN_NOAFI_ACTIVATED;
+ }
/* Last read and reset time set */
peer->readtime = peer->resettime = bgp_clock();
diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h
index 880fceb8f..477c03600 100644
--- a/bgpd/bgpd.h
+++ b/bgpd/bgpd.h
@@ -1197,6 +1197,7 @@ struct peer {
#define PEER_DOWN_WAITING_NHT 27 /* Waiting for NHT to resolve */
#define PEER_DOWN_NBR_ADDR 28 /* Waiting for peer IPv6 IP Addr */
#define PEER_DOWN_VRF_UNINIT 29 /* Associated VRF is not init yet */
+#define PEER_DOWN_NOAFI_ACTIVATED 30 /* No AFI/SAFI activated for peer */
size_t last_reset_cause_size;
uint8_t last_reset_cause[BGP_MAX_PACKET_SIZE];