ofproto-sflow: Maintain table of ports even when clearing configuration.
authorBen Pfaff <blp@nicira.com>
Fri, 7 May 2010 16:29:02 +0000 (09:29 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 12 May 2010 23:43:34 +0000 (16:43 -0700)
commit32d9dc1181e99ca891cb30a44ee709dcf9fb988f
treef79ca91582c1a805e4f3d9f9e69342de6c8a4b5b
parent0caf6bde24f37a616b64075e65ad5eede73398ba
ofproto-sflow: Maintain table of ports even when clearing configuration.

When ofproto_sflow_set_options() fails, it calls ofproto_sflow_clear() to
deconfigure the ofproto_sflow object.  But ofproto_sflow_clear() deletes
all of the object's record of datapath ports.  That means that the next
call to ofproto_sflow_set_options(), if it succeeds, will believe that the
datapath has no ports.

This commit fixes the problem by only clearing ofproto_sflow's record of
datapath ports when it is destroyed, not just when a configuration error
occurs.

Reported-by: Neil McKee <neil.mckee@inmon.com>
ofproto/ofproto-sflow.c