[quagga-users 7116] Re: Bgpd unable to shutdown neighbor?

Paul Jakma paul at clubi.ie
Wed Jun 21 16:41:07 IST 2006


On Thu, 8 Jun 2006, Tommy Eriksen wrote:

> When I shutdown a neighbor, it stays down for a minute or so, and 
> then reopens the connection. I tried with 2 different peers, same 
> problem. Is this a known bug?

Yes it is. Silly problem, I have a preliminary fix (see attached) 
which mostly alleviates this but it needs to be done slightly 
differently really for a full fix.

regards,
-- 
Paul Jakma	paul at clubi.ie	paul at jakma.org	Key ID: 64A2FF6A
Fortune:
"OK, now let's look at four dimensions on the blackboard."
 		-- Dr. Joy
-------------- next part --------------
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c
index f5f7892..770a791 100644
--- a/bgpd/bgp_fsm.c
+++ b/bgpd/bgp_fsm.c
@@ -511,25 +511,6 @@ #endif /* HAVE_SNMP */
       peer->fd = -1;
     }
 
-  /* Connection information. */
-  if (peer->su_local)
-    {
-      sockunion_free (peer->su_local);
-      peer->su_local = NULL;
-    }
-
-  if (peer->su_remote)
-    {
-      sockunion_free (peer->su_remote);
-      peer->su_remote = NULL;
-    }
-
-  /* Clear remote router-id. */
-  peer->remote_id.s_addr = 0;
-
-  /* Clear peer capability flag. */
-  peer->cap = 0;
-
   for (afi = AFI_IP ; afi < AFI_MAX ; afi++)
     for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++)
       {
@@ -644,6 +625,28 @@ bgp_start (struct peer *peer)
 {
   int status;
 
+  /* Scrub some information that might be left over from a previous,
+   * session
+   */
+  /* Connection information. */
+  if (peer->su_local)
+    {
+      sockunion_free (peer->su_local);
+      peer->su_local = NULL;
+    }
+
+  if (peer->su_remote)
+    {
+      sockunion_free (peer->su_remote);
+      peer->su_remote = NULL;
+    }
+
+  /* Clear remote router-id. */
+  peer->remote_id.s_addr = 0;
+
+  /* Clear peer capability flag. */
+  peer->cap = 0;
+    
   /* If the peer is passive mode, force to move to Active mode. */
   if (CHECK_FLAG (peer->flags, PEER_FLAG_PASSIVE))
     {


More information about the Quagga-users mailing list