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."
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;