From cd3ac840dd771ee1ef6410326353361c7185e159 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 13 Aug 2008 11:21:49 -0700 Subject: [PATCH] rconn: Queue packets for tx only if connected. Until now, the rconn code would queue up packets not just while connected but also while connecting. This is not just unnecessary, however, it actually causes a problem in secchan: if the secchan receives packets from nl:0 and tries to transmit them, then they will quickly fill up the rconn's transmit buffer (it uses a 1-packet buffer), which causes secchan to stop reading packets from nl:0 until the buffer frees up. That cannot happen until the connection completes. With in-band control, however, the connection cannot complete until we receive and process packet_in messages in our in-band hook. Thus, we have a deadlock. Fixes bug #90, "Sometimes secchan has to go into fail-open mode to connect." --- lib/rconn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rconn.c b/lib/rconn.c index 6bc371ad..a4ff91a2 100644 --- a/lib/rconn.c +++ b/lib/rconn.c @@ -446,7 +446,7 @@ rconn_recv_wait(struct rconn *rc) int rconn_send(struct rconn *rc, struct buffer *b, int *n_queued) { - if (rc->vconn) { + if (rconn_is_connected(rc)) { b->private = n_queued; if (n_queued) { ++*n_queued; -- 2.30.2