From 8ffeaddb5fdf780134b9eb6e8c54e9334147d3a5 Mon Sep 17 00:00:00 2001 From: Emanuele Di Pascale Date: Mon, 9 Nov 2020 11:05:04 +0100 Subject: [PATCH] bgpd: avoid needless ebgp mhop reset if the user sets the ebgp-multihop for a neighbor to the same value we currently have, avoid resetting the session and just return a silent success. Signed-off-by: Emanuele Di Pascale --- bgpd/bgpd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index df453dd993..d2d94707a7 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -4505,6 +4505,10 @@ int peer_ebgp_multihop_set(struct peer *peer, int ttl) if (peer->sort == BGP_PEER_IBGP || peer->conf_if) return 0; + /* is there anything to do? */ + if (peer->ttl == ttl) + return 0; + /* see comment in peer_ttl_security_hops_set() */ if (ttl != MAXTTL) { if (CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP)) { -- 2.39.5