diff options
author | Jesse Gross <jesse@nicira.com> | 2010-12-16 14:27:47 -0800 |
---|---|---|
committer | Jesse Gross <jesse@nicira.com> | 2010-12-16 14:33:04 -0800 |
commit | b7b0c62097cbce87b247e30f16e1fbdd1770cca3 (patch) | |
tree | 12ee12f819e0109b7c29750c2f1da40ee2e01739 | |
parent | e0ce13c4dc34f44d81e0001882a0be88321b5c87 (diff) | |
download | openvswitch-b7b0c62097cbce87b247e30f16e1fbdd1770cca3.tar.gz |
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.
-rw-r--r-- | lib/odp-util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/odp-util.c b/lib/odp-util.c index 91320c458..547e87ed9 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -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; } |