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

odp-util: Correct length check in format_odp_action().

When printing the action list we first check that the size of the
action matches the expected length for that type.  However, when
doing the lookup we were passing in the length of the action, not
the type, leading to bogus values.
This commit is contained in:
Jesse Gross
2010-12-16 14:27:47 -08:00
parent e0ce13c4dc
commit b7b0c62097

View File

@@ -103,9 +103,9 @@ format_odp_action(struct ds *ds, const struct nlattr *a)
const uint8_t *eth;
ovs_be32 ip;
if (nl_attr_get_size(a) != odp_action_len(a->nla_len)) {
if (nl_attr_get_size(a) != odp_action_len(nl_attr_type(a))) {
ds_put_format(ds, "***bad action: length is %zu, expected %d*** ",
nl_attr_get_size(a), odp_action_len(a->nla_len));
nl_attr_get_size(a), odp_action_len(nl_attr_type(a)));
format_generic_odp_action(ds, a);
return;
}