From 7a8e9ed2f7d3cbd79f237e32ddbe97e651805a2d Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 7 Nov 2011 09:13:53 -0800 Subject: [PATCH] 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. --- lib/odp-util.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 2.30.2