From: Dinesh G Dutt Date: Fri, 22 Apr 2016 22:15:25 +0000 (-0700) Subject: Update last reset reason on interface down or neighbor addr loss. X-Git-Tag: frr-2.0-rc1~954 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=e60480bd74f4e47a34812eb3109a7cda2602fd0a;p=matthieu%2Ffrr.git Update last reset reason on interface down or neighbor addr loss. Ticket: Reviewed By: Testing Done: For interface-based peering, we don't update the reset reason to be interface down. Similarly, we don't update the reason to be loss of neighbor address (maybe due to RA loss). This patch addresses these limitations. --- diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index 871467343c..2373bff104 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -491,7 +491,9 @@ const char *peer_down_str[] = "Multihop config change", "NSF peer closed the session", "Intf peering v6only config change", - "BFD down received" + "BFD down received", + "Interface down", + "Neighbor address lost" }; static int diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index 94a0a566b5..43653a36f8 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -222,6 +222,7 @@ bgp_nbr_connected_delete (struct bgp *bgp, struct nbr_connected *ifc, int del) { if (peer->conf_if && (strcmp (peer->conf_if, ifc->ifp->name) == 0)) { + peer->last_reset = PEER_DOWN_NBR_ADDR_DEL; BGP_EVENT_ADD (peer, BGP_Stop); } } @@ -344,7 +345,10 @@ bgp_interface_down (int command, struct zclient *zclient, zebra_size_t length, continue; if (ifp == peer->nexthop.ifp) - BGP_EVENT_ADD (peer, BGP_Stop); + { + BGP_EVENT_ADD (peer, BGP_Stop); + peer->last_reset = PEER_DOWN_IF_DOWN; + } } } diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index 3fe86e4eb6..a07bd389f5 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -834,6 +834,8 @@ struct peer #define PEER_DOWN_NSF_CLOSE_SESSION 22 /* NSF tcp session close */ #define PEER_DOWN_V6ONLY_CHANGE 23 /* if-based peering v6only toggled */ #define PEER_DOWN_BFD_DOWN 24 /* BFD down */ +#define PEER_DOWN_IF_DOWN 25 /* Interface down */ +#define PEER_DOWN_NBR_ADDR_DEL 26 /* Peer address lost */ unsigned long last_reset_cause_size; u_char last_reset_cause[BGP_MAX_PACKET_SIZE];