summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmanuele Di Pascale <emanuele@voltanet.io>2020-11-09 11:05:04 +0100
committerEmanuele Di Pascale <emanuele@voltanet.io>2020-11-09 13:54:35 +0100
commit8ffeaddb5fdf780134b9eb6e8c54e9334147d3a5 (patch)
tree5a91da8d656957ad096d04c4d3f54a617a749517
parent340434461b26e454eab6557eaf7a96e5dd0d7997 (diff)
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 <emanuele@voltanet.io>
-rw-r--r--bgpd/bgpd.c4
1 files changed, 4 insertions, 0 deletions
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)) {