summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2017-08-10 08:19:33 +0200
committerGitHub <noreply@github.com>2017-08-10 08:19:33 +0200
commit043abefeb24c34a51a37345d0b928bbf38f1e632 (patch)
treee86aa780a6cb46335ffee2e43723763a6543d87a
parentMerge pull request #938 from LabNConsulting/working/master/patch/pr784-partia... (diff)
parentbgpd: do not bounce peer when re-binding to current peer-group (diff)
downloadfrr-043abefeb24c34a51a37345d0b928bbf38f1e632.tar.xz
frr-043abefeb24c34a51a37345d0b928bbf38f1e632.zip
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.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index d30def0f0..5a423e0c7 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 */