[quagga-dev 8875] [PATCH] bgpd: remove password set by peer-group

Robert Bays robert at vyatta.com
Thu Sep 29 00:12:53 BST 2011


Remove a password that was set by peer-group membership
when peer is removed from the peer-group.

* bgpd.c
  * peer_group_unbind(): check if password set in peer
    and group. Remove if equal.
---
 bgpd/bgpd.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index ee0cc5d..c5f580b 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -1903,6 +1903,12 @@ peer_group_unbind (struct bgp *bgp, struct peer *peer,
 	  return 0;
 	}
       peer_global_config_reset (peer);
+      if (group->conf->password != NULL &&
+          strcmp(peer->password, group->conf->password) == 0)
+	{
+	  XFREE (MTYPE_PEER_PASSWORD, peer->password);
+	  peer->password = NULL;
+	}
     }
 
   if (peer->status == Established)
-- 
1.7.2.5




More information about the Quagga-dev mailing list