diff options
| author | David Lamparter <equinox@diac24.net> | 2017-08-10 08:19:33 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-08-10 08:19:33 +0200 |
| commit | 043abefeb24c34a51a37345d0b928bbf38f1e632 (patch) | |
| tree | e86aa780a6cb46335ffee2e43723763a6543d87a | |
| parent | 165089f1049df6f4ce33e98a9ec2a2c4b3ab849d (diff) | |
| parent | d8a079e8a2fad1de2372cea63c8857c411e6c4b5 (diff) | |
Merge pull request #941 from dwalton76/bgpd-peer-group-rebind
bgpd: do not bounce peer when re-binding to current peer-group
| -rw-r--r-- | bgpd/bgpd.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index d30def0f07..5a423e0c71 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -2518,11 +2518,18 @@ 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 */ |
