diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c index 8fce546f4a2..83f06f30f12 100644 --- a/lib/ofp-parse.c +++ b/lib/ofp-parse.c @@ -1333,7 +1333,7 @@ parse_ofp_group_mod_str__(struct ofputil_group_mod *gm, uint16_t command, } else if (!strcmp(value, "last")) { gm->command_bucket_id = OFPG15_BUCKET_LAST; } else { - char *error = str_to_u32(value, &gm->command_bucket_id); + error = str_to_u32(value, &gm->command_bucket_id); if (error) { goto out; } diff --git a/tests/ofproto.at b/tests/ofproto.at index 5ae313998ad..acab26e5b08 100644 --- a/tests/ofproto.at +++ b/tests/ofproto.at @@ -454,6 +454,11 @@ AT_CHECK([STRIP_XIDS stdout], [0], [dnl OFPST_GROUP_DESC reply (OF1.5): group_id=1234,type=all,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15,bucket=bucket_id:20,actions=output:20,bucket=bucket_id:21,actions=output:21 ]) + +# Negative test. +AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=0xffffff01,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1], [1], [], + [ovs-ofctl: invalid command bucket id 4294967041 +]) OVS_VSWITCHD_STOP AT_CLEANUP