Found by sparse.

CC: Jarno Rajahalme <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
---
 ofproto/ofproto-dpif-xlate.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index ab4d52f..eeb919d 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -4262,11 +4262,12 @@ put_ct_nat(struct xlate_ctx *ctx)
             nl_msg_put_flag(ctx->odp_actions, OVS_NAT_ATTR_PROTO_RANDOM);
         }
         if (ofn->range_af == AF_INET) {
-            nl_msg_put_u32(ctx->odp_actions, OVS_NAT_ATTR_IP_MIN,
+            nl_msg_put_be32(ctx->odp_actions, OVS_NAT_ATTR_IP_MIN,
                            ofn->range.addr.ipv4.min);
             if (ofn->range.addr.ipv4.max &&
-                ofn->range.addr.ipv4.max > ofn->range.addr.ipv4.min) {
-                nl_msg_put_u32(ctx->odp_actions, OVS_NAT_ATTR_IP_MAX,
+                (ntohl(ofn->range.addr.ipv4.max)
+                 > ntohl(ofn->range.addr.ipv4.min))) {
+                nl_msg_put_be32(ctx->odp_actions, OVS_NAT_ATTR_IP_MAX,
                                ofn->range.addr.ipv4.max);
             }
         } else if (ofn->range_af == AF_INET6) {
-- 
2.1.3

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to