mirror of
https://github.com/openvswitch/ovs
synced 2025-08-30 22:05:19 +00:00
ofp-parse: Properly report error for invalid bucket ID.
The inner 'error' shadowed an outer one, so that the error, when set, was never returned to the caller. Found by LLVM scan-build. Reported-by: Kevin Lo <kevlo@FreeBSD.org> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
This commit is contained in:
@@ -1333,7 +1333,7 @@ parse_ofp_group_mod_str__(struct ofputil_group_mod *gm, uint16_t command,
|
|||||||
} else if (!strcmp(value, "last")) {
|
} else if (!strcmp(value, "last")) {
|
||||||
gm->command_bucket_id = OFPG15_BUCKET_LAST;
|
gm->command_bucket_id = OFPG15_BUCKET_LAST;
|
||||||
} else {
|
} else {
|
||||||
char *error = str_to_u32(value, &gm->command_bucket_id);
|
error = str_to_u32(value, &gm->command_bucket_id);
|
||||||
if (error) {
|
if (error) {
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@@ -454,6 +454,11 @@ AT_CHECK([STRIP_XIDS stdout], [0], [dnl
|
|||||||
OFPST_GROUP_DESC reply (OF1.5):
|
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
|
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
|
OVS_VSWITCHD_STOP
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user