From: vivek Date: Wed, 21 Oct 2015 05:01:49 +0000 (-0700) Subject: BGP: Do not get out of bgp_start() if peer's IP address isn't known X-Git-Tag: frr-2.0-rc1~1227 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=085567f9553966f0042cd2f7cda0551a84f63b2f;p=matthieu%2Ffrr.git BGP: Do not get out of bgp_start() if peer's IP address isn't known Ticket: CM-7140 Reviewed By: CCR-3412 Testing Done: bgpsmoke, Atul verified fix BGP Unnumbered and Interface based peering can interact in some strange ways. One of them is when there's an IPv4 address on a link on which BGP Unnumbered session is beng attempted, but the IPv4 address is not a /30 or /31. As per the bug report, we end up attempting to start the BGP FSM on receiving a notification that an IPv4 address is present on an interface. To avoid attempting to go past BGP's start state in the absence of a valid peer address is the right thing to do. And this simple patch does just that. Signed-off-by: Dinesh G Dutt Reviewed-by: Donald Sharp Reviewed-by: Vipin Kumar --- diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index c8605da956..9bfb730469 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -1256,6 +1256,14 @@ bgp_start (struct peer *peer) bgp_peer_conf_if_to_su_update(peer); + if (peer->su.sa.sa_family == AF_UNSPEC) + { + if (bgp_debug_neighbor_events(peer)) + zlog_debug ("%s [FSM] Unable to get neighbor's IP address, waiting...", + peer->host); + return -1; + } + if (BGP_PEER_START_SUPPRESSED (peer)) { if (bgp_debug_neighbor_events(peer))