From 3fa113f00cf15f8248db399b6da7210e8db3ceb4 Mon Sep 17 00:00:00 2001 From: radhika Date: Fri, 6 Jan 2017 12:54:25 -0800 Subject: bgpd, zebra: Fix for ignored non-default VRF single-hop BFD status messages in Quagga MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ticket: CM-13425 Reviewed By: Donald, Kanna Testing Done: Unit, Min tests, PTM Smoke and Nightly, BGP Smoke Issue: BFD status up/down not reflected in the Quagga for non-default VRF single-hop BFD sessions. Root Cause: PTM doesn’t keep track of VRF for Single hop BFD sessions since they are interface-based sessions. The status up/down messages to the quagga for single hop sessions do not have VRF information. In zebra daemon, the interface search based on the interface name extracted from the BFD status message is done across all VRFs. So, the search does not fail in zebra daemon. But, the interface search in bgpd/ospd is done per vrf and default VRF is used for search if no VRF is sent in the status message. So, the search fails and the BFD status changes are ignored. Fix: The VRF information is extracted from the interface if VRF is not sent in the BFD status messages in zebra daemon and passed to bgpd/ospfd. The interface search will not fail since the appropriate VRF is passed to bgpd/ospfd and BFD satus changes are not ignored. Signed-off-by: Radhika Mahankali --- bgpd/bgp_bfd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bgpd/bgp_bfd.c') diff --git a/bgpd/bgp_bfd.c b/bgpd/bgp_bfd.c index ad221d922..4f76fd17f 100644 --- a/bgpd/bgp_bfd.c +++ b/bgpd/bgp_bfd.c @@ -311,14 +311,14 @@ bgp_bfd_dest_update (int command, struct zclient *zclient, prefix2str(&dp, buf[0], sizeof(buf[0])); if (ifp) { - zlog_debug("Zebra: interface %s bfd destination %s %s", - ifp->name, buf[0], bfd_get_status_str(status)); + zlog_debug("Zebra: vrf %d interface %s bfd destination %s %s", + vrf_id, ifp->name, buf[0], bfd_get_status_str(status)); } else { prefix2str(&sp, buf[1], sizeof(buf[1])); - zlog_debug("Zebra: source %s bfd destination %s %s", - buf[1], buf[0], bfd_get_status_str(status)); + zlog_debug("Zebra: vrf %d source %s bfd destination %s %s", + vrf_id, buf[1], buf[0], bfd_get_status_str(status)); } } -- cgit v1.2.3 From 5c940836ab4c5e6716cc178f976e2d1a9d386bbf Mon Sep 17 00:00:00 2001 From: radhika Date: Thu, 19 Jan 2017 14:23:21 -0800 Subject: bgpd: Update BFD status when de-registering with PTM Ticket: CM-14301 Reviewed By: Donald, Vivek Testing Done: Unit, Min tests, PTM and BFD Smoke, BGP Smoke Issue: BFD status is not changed from up to down for bgp peer even after the BFD session has been de-registered by bgpd. Root Cause: This issue happens when bgpd detects peer down before getting the BFD down from PTM. bgpd will send the de-reg bfd session message to ptm after detecting peer down. If ptm receives the de-reg message before it detects the peer down, then the down message will not be sent to Quagga. This causes the bfd status in bgpd to remain unchanged. Fix: Update the BFD status to down in bgpd before de-registering the session from PTM. Signed-off-by: Radhika Mahankali --- bgpd/bgp_bfd.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'bgpd/bgp_bfd.c') diff --git a/bgpd/bgp_bfd.c b/bgpd/bgp_bfd.c index 4f76fd17f..3def3421a 100644 --- a/bgpd/bgp_bfd.c +++ b/bgpd/bgp_bfd.c @@ -171,6 +171,9 @@ bgp_bfd_deregister_peer (struct peer *peer) if (!CHECK_FLAG(bfd_info->flags, BFD_FLAG_BFD_REG)) return; + bfd_info->status = BFD_STATUS_DOWN; + bfd_info->last_update = bgp_clock(); + bgp_bfd_peer_sendmsg(peer, ZEBRA_BFD_DEST_DEREGISTER); } -- cgit v1.2.3