From: Ben Pfaff Date: Wed, 13 Aug 2008 18:21:49 +0000 (-0700) Subject: rconn: Queue packets for tx only if connected. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd3ac840dd771ee1ef6410326353361c7185e159;p=openvswitch 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." --- 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;