]> git.puffer.fish Git - matthieu/frr.git/commitdiff
When a peer is unbound from its peer-group, in some situations the peer is
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 20 May 2015 01:04:18 +0000 (18:04 -0700)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 20 May 2015 01:04:18 +0000 (18:04 -0700)
deleted while in other situations, the peer continues to exist but its
global flags have all been reset. This is incorrect, particularly for the
CONFIG_NODE flag as other parts of the code depend on this flag being set
for a configured peer. This patch ensures that the correct flags still
remain set for the peer after unbind from its peer-group.

bgpd/bgpd.c

index 07124a26791e49397fc230531f8fc8efbf94a434..dce10886bb7850e59a709174342c849ddc3bf7ed 100644 (file)
@@ -806,6 +806,17 @@ peer_global_config_reset (struct peer *peer)
   peer->keepalive = 0;
   peer->connect = 0;
   peer->v_connect = BGP_DEFAULT_CONNECT_RETRY;
+
+  /* Reset some other configs back to defaults. */
+  peer->v_start = BGP_INIT_START_TIMER;
+  peer->v_asorig = BGP_DEFAULT_ASORIGINATE;
+  peer->password = NULL;
+  peer->local_id = peer->bgp->router_id;
+  peer->v_holdtime = peer->bgp->default_holdtime;
+  peer->v_keepalive = peer->bgp->default_keepalive;
+
+  /* Set back the CONFIG_NODE flag. */
+  SET_FLAG (peer->flags, PEER_FLAG_CONFIG_NODE);
 }
 
 /* Check peer's AS number and determines if this peer is IBGP or EBGP */