summaryrefslogtreecommitdiff
path: root/proto/bgp
diff options
context:
space:
mode:
Diffstat (limited to 'proto/bgp')
-rw-r--r--proto/bgp/packets.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c
index 2248b9f9..665a22c1 100644
--- a/proto/bgp/packets.c
+++ b/proto/bgp/packets.c
@@ -784,8 +784,12 @@ bgp_kick_tx(void *vconn)
struct bgp_conn *conn = vconn;
DBG("BGP: kicking TX\n");
- while (bgp_fire_tx(conn) > 0)
+ uint max = 1024;
+ while (--max && (bgp_fire_tx(conn) > 0))
;
+
+ if (!max && !ev_active(conn->tx_ev))
+ ev_schedule(conn->tx_ev);
}
void
@@ -794,8 +798,12 @@ bgp_tx(sock *sk)
struct bgp_conn *conn = sk->data;
DBG("BGP: TX hook\n");
- while (bgp_fire_tx(conn) > 0)
+ uint max = 1024;
+ while (--max && (bgp_fire_tx(conn) > 0))
;
+
+ if (!max && !ev_active(conn->tx_ev))
+ ev_schedule(conn->tx_ev);
}
/* Capatibility negotiation as per RFC 2842 */