rconn: Discover errors in rconn_run() even if rconn_recv() is never called.
authorBen Pfaff <blp@nicira.com>
Thu, 27 Feb 2014 19:06:30 +0000 (11:06 -0800)
committerBen Pfaff <blp@nicira.com>
Thu, 27 Feb 2014 22:09:46 +0000 (14:09 -0800)
commitaccaecc419cc57d9517f66d205ed90e83522f771
tree7f19eb4f835a1975d1f3e2c27c84b7c3d5749c2f
parent3b401f9baf4c0dd9e9eebb0a9f4417fdf3a80774
rconn: Discover errors in rconn_run() even if rconn_recv() is never called.

rconn_recv() calls vconn_recv(), which will report a connection error and
cause rconn_recv() to disconnect the rconn.  Most rconn users regularly
call rconn_recv(), so that disconnection happens promptly.  However,
the lswitch code only calls rconn_recv() after the connection negotiates an
OpenFlow version, so a connection that failed before negotiation would
never be detected as failed.  This commit fixes the problem by making
rconn_run() also detect and handle connection errors.

The lswitch code is only used by the test-controller program, so this is
not an important bug fix.

Reported-by: Vasu Dasari <vdasari@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/rconn.c
lib/vconn.c
lib/vconn.h