]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: do not bounce peer when re-binding to current peer-group
authorDaniel Walton <dwalton@cumulusnetworks.com>
Wed, 9 Aug 2017 16:04:55 +0000 (20:04 +0400)
committerDaniel Walton <dwalton@cumulusnetworks.com>
Wed, 9 Aug 2017 16:04:55 +0000 (20:04 +0400)
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
bgpd/bgpd.c

index d30def0f07837f5db361068305f585d6f51fba67..75975b8d682baa619314acc2b7ea585ad0bdafc7 100644 (file)
@@ -2518,11 +2518,17 @@ int peer_group_bind(struct bgp *bgp, union sockunion *su, struct peer *peer,
 
        /* The peer exist, bind it to the peer-group */
        if (peer) {
-               /* When the peer already belongs to peer group, check the
+               /* When the peer already belongs to a peer-group, check the
                 * consistency.  */
-               if (peer_group_active(peer)
-                   && strcmp(peer->group->name, group->name) != 0)
-                       return BGP_ERR_PEER_GROUP_CANT_CHANGE;
+               if (peer_group_active(peer)) {
+
+                       /* The peer is already bound to the peer-group,
+                        * nothing to do */
+                       if (strcmp(peer->group->name, group->name) == 0)
+                               return 0;
+                       else
+                               return BGP_ERR_PEER_GROUP_CANT_CHANGE;
+               }
 
                /* The peer has not specified a remote-as, inherit it from the
                 * peer-group */