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:31:21 +0000 (14:31 -0800)
commitc7ecbf1e9c5d0cd849455f273f922c4cfb0c100f
treeb4c59c4ac8673beca7bb442897e43442fbb5cbb2
parentee32150e7fd5fcfc82e0ff952215637b3c9af7d7
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.h
lib/ofp-parse.c