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

lib/odp-util: Only use expected_bit when set.

parse_l2_5_onward() previously used out of range 'expected_bit' when
it was called with no attrs, which happens when parsing a mask with
zero length.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Jarno Rajahalme
2013-12-06 08:30:17 -08:00
parent df85c52098
commit df4eeb2030

View File

@@ -2871,7 +2871,7 @@ parse_l2_5_onward(const struct nlattr *attrs[OVS_KEY_ATTR_MAX + 1],
} else {
goto done;
}
if (is_mask) {
if (check_len > 0) { /* Happens only when 'is_mask'. */
if (!is_all_zeros(check_start, check_len) &&
flow->dl_type != htons(0xffff)) {
return ODP_FIT_ERROR;