Skip to content

Commit a7825b9

Browse files
committed
odp-util: Fix tunnel key attribute length checks.
The expected length check is using the OVS_TUNNEL_ATTR_MAX, that limits OVS_VPORT_ATTR_OPTIONS, as a limit for OVS_TUNNEL_KEY_ATTR_* attributes. That means that the majority of the tunnel attributes are not checked (OVS_TUNNEL_ATTR_MAX is 2, the values above that are skipped). This is not a big deal, as we're parsing the values that either we did generate ourselves, or the values that kernel provided to us. So the values can't really be wrong, unless there is a bug somewhere else in OVS or in the kernel. But we should still check things properly. Use the correct OVS_TUNNEL_KEY_ATTR_MAX instead. Fixes: 6b8da9e ("odp-util: Correctly generate wildcards when formating nested attributes.") Acked-by: Aaron Conole <aconole@redhat.com> Acked-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
1 parent ee01cf8 commit a7825b9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/odp-util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3100,7 +3100,7 @@ odp_tun_key_from_attr__(const struct nlattr *attr, bool is_mask,
31003100
uint16_t type = nl_attr_type(a);
31013101
size_t len = nl_attr_get_size(a);
31023102
int expected_len = odp_key_attr_len(ovs_tun_key_attr_lens,
3103-
OVS_TUNNEL_ATTR_MAX, type);
3103+
OVS_TUNNEL_KEY_ATTR_MAX, type);
31043104

31053105
if (len != expected_len && expected_len >= 0) {
31063106
odp_parse_error(&rl, errorp, "tunnel key attribute %"PRIu16" "

0 commit comments

Comments
 (0)