ofp-parse: Correctly update bucket lists if they are empty.
authorBen Pfaff <blp@nicira.com>
Fri, 13 Feb 2015 22:31:21 +0000 (14:31 -0800)
committerBen Pfaff <blp@nicira.com>
Fri, 13 Feb 2015 22:36:06 +0000 (14:36 -0800)
commitd74152155e4d7e26e460812994c1fcfac5a9c396
tree72bc71b820b0b4bb673a425a2ba80d3c308f8ae3
parent76438eddf5c41c07a0f53bf3eb7e8f172ff498b6
ofp-parse: Correctly update bucket lists if they are empty.

Previously, list_moved() only worked with non-empty lists, but this was a
caveat that was really easy to miss.  parse_ofp_group_mod_file() had a bug
because it didn't honor that restriction.  This commit fixes the problem,
by modifying the list_moved() interface to be harder to use incorrectly
and then updating the callers.

Reported-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
lib/list.c
lib/list.h
lib/ofp-parse.c