From 37bb7aca30eb0997820e888dcd171f7f3c86bffa Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Thu, 2 May 2019 09:35:29 +0200 Subject: [PATCH 1/2] bgpd: add bfd event trace that bfd event trace is visible when 'debug bgp neighbor-event' is enabled. Signed-off-by: Philippe Guibert --- bgpd/bgp_bfd.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bgpd/bgp_bfd.c b/bgpd/bgp_bfd.c index dadf124eec..f1737ff9f0 100644 --- a/bgpd/bgp_bfd.c +++ b/bgpd/bgp_bfd.c @@ -276,6 +276,11 @@ static void bgp_bfd_peer_status_update(struct peer *peer, int status) bfd_info->status = status; bfd_info->last_update = bgp_clock(); + if (status != old_status) { + if (BGP_DEBUG(neighbor_events, NEIGHBOR_EVENTS)) + zlog_debug("[%s]: BFD %s", peer->host, + bfd_get_status_str(status)); + } if ((status == BFD_STATUS_DOWN) && (old_status == BFD_STATUS_UP)) { peer->last_reset = PEER_DOWN_BFD_DOWN; BGP_EVENT_ADD(peer, BGP_Stop); From 4828ea7749f62d503ff0b322a39d0ecd452db601 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Thu, 2 May 2019 09:36:06 +0200 Subject: [PATCH 2/2] ospfd: add bfd up event trace that bfd trace is visible when using 'debug ospf nsm event' command. Signed-off-by: Philippe Guibert --- ospfd/ospf_bfd.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ospfd/ospf_bfd.c b/ospfd/ospf_bfd.c index 594735a08f..a4f66ab70a 100644 --- a/ospfd/ospf_bfd.c +++ b/ospfd/ospf_bfd.c @@ -251,6 +251,13 @@ static int ospf_bfd_interface_dest_update(int command, struct zclient *zclient, OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_InactivityTimer); } + if ((status == BFD_STATUS_UP) + && (old_status == BFD_STATUS_DOWN)) { + if (IS_DEBUG_OSPF(nsm, NSM_EVENTS)) + zlog_debug("NSM[%s:%s]: BFD Up", + IF_NAME(nbr->oi), + inet_ntoa(nbr->address.u.prefix4)); + } } return 0;