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

odp-util: Fix misleading parameter names.

The 'max_len' parameters to these functions are actually the maximum type
values, not the maximum length of anything.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
This commit is contained in:
Ben Pfaff
2017-07-28 14:23:57 -07:00
parent ec30ca5f1c
commit ce9c9b8bbf

View File

@@ -1977,9 +1977,9 @@ static const struct attr_len_tbl ovs_flow_key_attr_lens[OVS_KEY_ATTR_MAX + 1] =
* if the attribute's payload is variable length, or ATTR_LEN_NESTED if the
* payload is a nested type. */
static int
odp_key_attr_len(const struct attr_len_tbl tbl[], int max_len, uint16_t type)
odp_key_attr_len(const struct attr_len_tbl tbl[], int max_type, uint16_t type)
{
if (type > max_len) {
if (type > max_type) {
return ATTR_LEN_INVALID;
}
@@ -2475,11 +2475,11 @@ format_tun_flags(struct ds *ds, const char *name, uint16_t key,
static bool
check_attr_len(struct ds *ds, const struct nlattr *a, const struct nlattr *ma,
const struct attr_len_tbl tbl[], int max_len, bool need_key)
const struct attr_len_tbl tbl[], int max_type, bool need_key)
{
int expected_len;
expected_len = odp_key_attr_len(tbl, max_len, nl_attr_type(a));
expected_len = odp_key_attr_len(tbl, max_type, nl_attr_type(a));
if (expected_len != ATTR_LEN_VARIABLE &&
expected_len != ATTR_LEN_NESTED) {