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 <[email protected]>
Fixes: 6dd3c787f591 ("ofproto: Support packet_outs in bundles.")
Signed-off-by: Ben Pfaff <[email protected]>
---
lib/ofp-parse.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c
index 0568fc7..a347b53 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(
--
2.1.3
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev