2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

ofp-util: Add missing 'break;' in bad_group_cmd().

Otherwise you get an assertion failure in place of a helpful error message.

Also fix typo where the "remove-bucket" command was output as
"insert-bucket".

Also fix a nearby style violation and add a pair of tests to prevent
regression.

Found by LLVM scan-build.

Reported-by: Kevin Lo <kevlo@FreeBSD.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
This commit is contained in:
Ben Pfaff
2015-04-21 20:00:50 -07:00
parent 966904d27f
commit 9dd30b0571
2 changed files with 12 additions and 3 deletions

View File

@@ -8170,7 +8170,8 @@ ofputil_encode_ofp15_group_mod(enum ofp_version ofp_version,
}
static void
bad_group_cmd(enum ofp15_group_mod_command cmd) {
bad_group_cmd(enum ofp15_group_mod_command cmd)
{
const char *opt_version;
const char *version;
const char *cmd_str;
@@ -8187,6 +8188,7 @@ bad_group_cmd(enum ofp15_group_mod_command cmd) {
case OFPGC15_REMOVE_BUCKET:
version = "1.5";
opt_version = "15";
break;
default:
OVS_NOT_REACHED();
@@ -8210,7 +8212,7 @@ bad_group_cmd(enum ofp15_group_mod_command cmd) {
break;
case OFPGC15_REMOVE_BUCKET:
cmd_str = "insert-bucket";
cmd_str = "remove-bucket";
break;
default: