summaryrefslogtreecommitdiff
path: root/lib/ofp-parse.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2016-09-14 20:59:10 -0700
committerBen Pfaff <blp@ovn.org>2016-09-16 10:43:15 -0700
commit16cf531e2e35d62331378c52751bfb85f0e75e86 (patch)
tree9a7a4eef22aadd2249c9884f60b1317b78f786c4 /lib/ofp-parse.c
parent76f3c26071f665ac00d63d78abb277542aa921df (diff)
downloadopenvswitch-16cf531e2e35d62331378c52751bfb85f0e75e86.tar.gz
ofp-parse: Fix sparse warnings about comparing ofp_port_ts.
Without this, sparse complains: lib/ofp-parse.c:588:19: warning: restricted ofp_port_t degrades to integer lib/ofp-parse.c:588:31: warning: restricted ofp_port_t degrades to integer This is one of the irritating bits of using sparse, but on the whole I think it saves us pretty often. CC: Jarno Rajahalme <jarno@ovn.org> Fixes: 6dd3c787f591 ("ofproto: Support packet_outs in bundles.") Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Joe Stringer <joe@ovn.org>
Diffstat (limited to 'lib/ofp-parse.c')
-rw-r--r--lib/ofp-parse.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c
index 2980a1df3..584ac1ae7 100644
--- a/lib/ofp-parse.c
+++ b/lib/ofp-parse.c
@@ -585,7 +585,8 @@ parse_ofp_packet_out_str__(struct ofputil_packet_out *po, char *string,
error = xasprintf("%s is not a valid OpenFlow port", value);
goto out;
}
- if (po->in_port > OFPP_MAX && po->in_port != OFPP_LOCAL
+ if (ofp_to_u16(po->in_port) > ofp_to_u16(OFPP_MAX)
+ && po->in_port != OFPP_LOCAL
&& po->in_port != OFPP_NONE
&& po->in_port != OFPP_CONTROLLER) {
error = xasprintf(