From 3557ed3d32f7eb166997ebcde3fc624927b6f553 Mon Sep 17 00:00:00 2001 From: Alexander Chernavin Date: Tue, 25 Aug 2020 09:51:22 -0400 Subject: [PATCH] bgpd: reset session if ebgp-multihop is set and no session established If you configure eBGP on loopbacks, you might miss setting the ebgp-multihop option. Given that, the session will not be established because of this. Now, the session is in Active state. When you update your config afterwards and set the ebgp-multihop option to the appropriate value, the session will still be in Active state. In fact, it will be stuck in Active state and only services restart will help. With this change, when set the ebgp-multihop option and no session was established, reset the session. Signed-off-by: Alexander Chernavin --- bgpd/bgpd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 12817a083..46cbc7d2e 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -4382,7 +4382,7 @@ int peer_ebgp_multihop_set(struct peer *peer, int ttl) peer->ttl = ttl; if (!CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP)) { - if (peer->fd >= 0 && peer->sort != BGP_PEER_IBGP) { + if (peer->sort != BGP_PEER_IBGP) { if (BGP_IS_VALID_STATE_FOR_NOTIF(peer->status)) bgp_notify_send(peer, BGP_NOTIFY_CEASE, BGP_NOTIFY_CEASE_CONFIG_CHANGE);