diff options
author | Ben Pfaff <blp@nicira.com> | 2011-11-07 09:13:53 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2011-11-11 14:07:16 -0800 |
commit | 7a8e9ed2f7d3cbd79f237e32ddbe97e651805a2d (patch) | |
tree | e27af828d46ffa8c86ed88e8cde4674e8a0c36fa /lib/odp-util.c | |
parent | 744791b56bc30ac713735d17e05505843071c3be (diff) |
odp-util: Trigger warning for unhandled attrs in format_odp_key_attr().
I usually do things this way but must have overlooked this one a while ago.
Diffstat (limited to 'lib/odp-util.c')
-rw-r--r-- | lib/odp-util.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/odp-util.c b/lib/odp-util.c index 06082f82..f6f443aa 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -348,6 +348,7 @@ format_odp_key_attr(const struct nlattr *a, struct ds *ds) const struct ovs_key_icmpv6 *icmpv6_key; const struct ovs_key_arp *arp_key; const struct ovs_key_nd *nd_key; + enum ovs_key_attr attr = nl_attr_type(a); if (nl_attr_get_size(a) != odp_flow_key_attr_len(nl_attr_type(a))) { ds_put_format(ds, "bad length %zu, expected %d for: ", @@ -357,7 +358,7 @@ format_odp_key_attr(const struct nlattr *a, struct ds *ds) return; } - switch (nl_attr_type(a)) { + switch (attr) { case OVS_KEY_ATTR_PRIORITY: ds_put_format(ds, "priority(%"PRIu32")", nl_attr_get_u32(a)); break; @@ -473,6 +474,8 @@ format_odp_key_attr(const struct nlattr *a, struct ds *ds) break; } + case OVS_KEY_ATTR_UNSPEC: + case __OVS_KEY_ATTR_MAX: default: format_generic_odp_key(a, ds); break; |