vconn: Fix detection of vconn local IP address, to fix in-band control.
authorBen Pfaff <blp@nicira.com>
Mon, 13 Jul 2009 22:05:51 +0000 (15:05 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 13 Jul 2009 22:06:59 +0000 (15:06 -0700)
commitd7cca8671055c79b1938de9731fb53ae6c32dc87
tree63468312ca90f64eed2dd544be4be35ed66f5400
parent00c030a5971ee311a474529407b3751b1fbacbcf
vconn: Fix detection of vconn local IP address, to fix in-band control.

The in-band control code needs to know the IP and port of both ends of the
control connection.  However, the vconn code was only reporting the local
address after the connection had already succeeded, which created a
chicken-and-egg problem.  In practice we would fail to connect until the
switch went into fail-open, at which point the connection would go through.

Fortunately, we can get the local IP address right after we try to connect,
not just after the connection completes, so this commit changes the code
to do that.

This commit also breaks setting the remote IP and port into functions
separate from vconn_init(), which makes the code more readable.
lib/vconn-provider.h
lib/vconn-ssl.c
lib/vconn-stream.c
lib/vconn-stream.h
lib/vconn-tcp.c
lib/vconn-unix.c
lib/vconn.c