]> git.proxmox.com Git - mirror_frr.git/commitdiff
[bgpd] Bug #302 fixes. ClearingCompleted event gets flushed, leaving peers stuck...
authorPaul Jakma <paul.jakma@sun.com>
Sun, 15 Oct 2006 23:39:59 +0000 (23:39 +0000)
committerPaul Jakma <paul.jakma@sun.com>
Sun, 15 Oct 2006 23:39:59 +0000 (23:39 +0000)
2006-10-14 Paul Jakma <paul.jakma@sun.com>

* bgp_fsm.h: Remove BGP_EVENT_FLUSH_ADD, dangerous and not
  needed.
* bgp_fsm.c: (bgp_stop) Move BGP_EVENT_FLUSH to the top of the
  of the function, otherwise it could flush a ClearingCompleted
          event, bug #302.
* bgp_packet.c: Replace all BGP_EVENT_FLUSH_ADD with
  BGP_EVENT_ADD, fixing bug #302.

bgpd/ChangeLog
bgpd/bgp_fsm.c
bgpd/bgp_fsm.h
bgpd/bgp_packet.c

index 2294f89a245f84ec72c559403b5811d8336b024e..c33562da1d6f21606c41af88d00d466cb1b51c43 100644 (file)
@@ -1,3 +1,13 @@
+2006-10-14 Paul Jakma <paul.jakma@sun.com>
+
+       * bgp_fsm.h: Remove BGP_EVENT_FLUSH_ADD, dangerous and not
+         needed.
+       * bgp_fsm.c: (bgp_stop) Move BGP_EVENT_FLUSH to the top of the
+         of the function, otherwise it could flush a ClearingCompleted
+          event, bug #302.
+       * bgp_packet.c: Replace all BGP_EVENT_FLUSH_ADD with
+         BGP_EVENT_ADD, fixing bug #302.
+
 2006-09-19 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
 
        * bgpd.c: (peer_uptime) Fix printf format/arg mismatch in
index cc2b2c3a8afd052050dc87423185c5a397131b38..ef8dfea43e140acc92f102b13278208531a1b6df 100644 (file)
@@ -428,6 +428,9 @@ bgp_stop (struct peer *peer)
   safi_t safi;
   char orf_name[BUFSIZ];
 
+  /* Delete all existing events of the peer */
+  BGP_EVENT_FLUSH (peer);
+
   /* Increment Dropped count. */
   if (peer->status == Established)
     {
@@ -499,9 +502,6 @@ bgp_stop (struct peer *peer)
   BGP_TIMER_OFF (peer->t_asorig);
   BGP_TIMER_OFF (peer->t_routeadv);
 
-  /* Delete all existing events of the peer */
-  BGP_EVENT_FLUSH (peer);
-  
   /* Stream reset. */
   peer->packet_size = 0;
 
index c51bed37eb5ee257475847a517d0d4f879db22b7..a749f8ea31d35419868d05cf57b0f778721f7d39 100644 (file)
@@ -71,12 +71,6 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
     thread_cancel_event (master, (P));                 \
   } while (0)
 
-#define BGP_EVENT_FLUSH_ADD(P,E)       \
-  do {                                 \
-    BGP_EVENT_FLUSH(P);                        \
-    BGP_EVENT_ADD(P,E);                        \
-  } while (0)
-
 /* Prototypes. */
 extern int bgp_event (struct thread *);
 extern int bgp_stop (struct peer *peer);
index da59d32983daef561a52adbc254d3d2f1aafefb5..cf6d00f1ae1692295f3a65af20c204d49b0b174c 100644 (file)
@@ -637,7 +637,7 @@ bgp_write (struct thread *thread)
          if (write_errno == EWOULDBLOCK || write_errno == EAGAIN)
              break;
 
-         BGP_EVENT_FLUSH_ADD (peer, TCP_fatal_error);
+         BGP_EVENT_ADD (peer, TCP_fatal_error);
          return 0;
        }
       if (num != writenum)
@@ -672,7 +672,7 @@ bgp_write (struct thread *thread)
            peer->v_start = (60 * 2);
 
          /* Flush any existing events */
-         BGP_EVENT_FLUSH_ADD (peer, BGP_Stop);
+         BGP_EVENT_ADD (peer, BGP_Stop);
          return 0;
        case BGP_MSG_KEEPALIVE:
          peer->keepalive_out++;
@@ -717,7 +717,7 @@ bgp_write_notify (struct peer *peer)
   ret = writen (peer->fd, STREAM_DATA (s), stream_get_endp (s));
   if (ret <= 0)
     {
-      BGP_EVENT_FLUSH_ADD (peer, TCP_fatal_error);
+      BGP_EVENT_ADD (peer, TCP_fatal_error);
       return 0;
     }
 
@@ -737,7 +737,7 @@ bgp_write_notify (struct peer *peer)
   if (peer->v_start >= (60 * 2))
     peer->v_start = (60 * 2);
 
-  BGP_EVENT_FLUSH_ADD (peer, BGP_Stop);
+  BGP_EVENT_ADD (peer, BGP_Stop);
 
   return 0;
 }