Not a real bug since htons() and ntohs() do the same thing on all
interesting target platforms.
Found by sparse.
---
ofproto/ofproto-dpif.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 4de5a4e..de600f0 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -1165,8 +1165,8 @@ stp_process_packet(const struct ofport_dpif *ofport,
}
/* Trim off padding on payload. */
- if (payload.size > htons(eth->eth_type) + ETH_HEADER_LEN) {
- payload.size = htons(eth->eth_type) + ETH_HEADER_LEN;
+ if (payload.size > ntohs(eth->eth_type) + ETH_HEADER_LEN) {
+ payload.size = ntohs(eth->eth_type) + ETH_HEADER_LEN;
}
if (ofpbuf_try_pull(&payload, ETH_HEADER_LEN + LLC_HEADER_LEN)) {
--
1.7.4.4
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev