learning-switch: Delay sending handshake until version negotiation is done.
authorBen Pfaff <blp@nicira.com>
Tue, 7 Aug 2012 17:38:35 +0000 (10:38 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 7 Aug 2012 19:41:58 +0000 (12:41 -0700)
commitf702893a7cc2380b2640e1ccb3a987d46766c685
tree2dead9100075f8dc37c1530e2c26cffd6119f73d
parent002c3f1734454492d921de29f2d5be6428ed1a18
learning-switch: Delay sending handshake until version negotiation is done.

The learning-switch implementation needs to know the OpenFlow version in
use to send the initial handshake messages (e.g. the feature request), but
the version is not always available at the time that the code currently
sends the handshake.  This can cause an assertion failure later when
ofputil_encode_flow_mod() checks the protocol, which will be 0 if the
version wasn't known.

This commit fixes the problem by introducing a state machine that sends the
handshake messages only after version negotiation has finished.

Reported-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/learning-switch.c