]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: avoid needless ebgp mhop reset
authorEmanuele Di Pascale <emanuele@voltanet.io>
Mon, 9 Nov 2020 10:05:04 +0000 (11:05 +0100)
committerEmanuele Di Pascale <emanuele@voltanet.io>
Mon, 9 Nov 2020 12:54:35 +0000 (13:54 +0100)
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>
bgpd/bgpd.c

index df453dd993c7d2edc8990ffc57913ae6810292f3..d2d94707a7fc117e3f90d22e17157615a633fb56 100644 (file)
@@ -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)) {