vconn: Ensure that vconn_run() is enough to complete a connection.
authorBen Pfaff <blp@nicira.com>
Tue, 7 Aug 2012 18:45:44 +0000 (11:45 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 7 Aug 2012 19:41:57 +0000 (12:41 -0700)
commit48d84b1706f76882bc5265c09257e70899fb9c41
treeec65a3ad03c18d10b8270c9dcd75d7855ffede68
parent922b3bab9235766934aa60712b1dbad2a17612ae
vconn: Ensure that vconn_run() is enough to complete a connection.

Until now, it seems that all vconn users have immediately started reading
messages from the connection.  Today, however, I added a new user that
only wants to read packets after the OpenFlow version is negotiated, so
it never called vconn_recv() before that happened.  It turns out that if
you do this, the version never gets negotiated at all.

This commit fixes the problem by ensuring that vconn_run() will continue
version negotiation if it isn't done yet.

This changes the error return that I get for Unix sockets in the
test-vconn "accept-then-close" test from EPIPE to ECONNRESET, so this
commit also adjusts that test to accept either error code; both of them
seem reasonable enough to me.

Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/vconn.c
tests/test-vconn.c