]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
BGP: Fixes serious bug in TX handling
authorOndrej Zajicek <santiago@crfreenet.org>
Tue, 31 Mar 2015 22:01:35 +0000 (00:01 +0200)
committerOndrej Zajicek <santiago@crfreenet.org>
Tue, 31 Mar 2015 22:10:00 +0000 (00:10 +0200)
Under some circumstances and heavy load, TX could be postponed
until the session fails with hold timer expired.

Thanks to Javor Kliachev for making the bug reproductible.

proto/bgp/packets.c

index 27d8272956d8cf2c83cb8b7207b6e51b72eb52a0..4bd68f520e87a8a59fdf030b71529287dc0370b7 100644 (file)
@@ -769,7 +769,7 @@ bgp_schedule_packet(struct bgp_conn *conn, int type)
 {
   DBG("BGP: Scheduling packet type %d\n", type);
   conn->packets_to_send |= 1 << type;
-  if (conn->sk && conn->sk->tpos == conn->sk->tbuf)
+  if (conn->sk && conn->sk->tpos == conn->sk->tbuf && !ev_active(conn->tx_ev))
     ev_schedule(conn->tx_ev);
 }