rconn: Fix null pointer dereference in rconn_add_monitor().
authorBen Pfaff <blp@nicira.com>
Fri, 4 Jan 2013 20:41:01 +0000 (12:41 -0800)
committerBen Pfaff <blp@nicira.com>
Thu, 24 Jan 2013 22:57:24 +0000 (14:57 -0800)
commit4766ce7a6438c11743c354fddad9d1164c76c467
tree4880b10c8ad9925c66ca1a46e46765aaeb68055d
parent539b741f5999e22de02b14a35cc3e3855e2dc51d
rconn: Fix null pointer dereference in rconn_add_monitor().

rconn_add_monitor() tries to check the version of the controller
connection being monitored, so that it can decide what OpenFlow version to
tell the monitor connection to negotiate.  But at any given time an rconn
may not have a controller connection (e.g. during backoff), so rc->vconn
may be null and thus vconn_get_version(rc->vconn) dereferences a null
pointer.

Fixing the problem in a local way would require the rconn to remember the
previous version negotiated, and that fails if the rconn hasn't yet
connected or if the next connection negotiates a new version.

This commit instead adds the ability to a vconn to accept any OpenFlow
message version and modifies "ovs-ofctl snoop" to use that feature, thus
removing the need to negotiate the "correct" version on snoops.

Bug #14265.
Reported-by: Pratap Reddy <preddy@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
lib/rconn.c
lib/vconn-provider.h
lib/vconn.c
lib/vconn.h
utilities/ovs-ofctl.c