[ovs-dev] [PATCH] ofproto: Maximum value of "int" is INT_MAX, not UINT32_MAX.

Ben Pfaff blp at nicira.com
Fri Apr 9 21:04:10 UTC 2010


This bug seems to be dormant at the moment, since the -1 gets passed
through unchanged to do_send_packet_in() and then to make_packet_in()
and then gets converted to SIZE_MAX as part of the MIN invocation in that
function.  It is still better to fix it.

Reported-by: Jean Tourrilhes <jt at hpl.hp.com>
---
 ofproto/ofproto.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index fd1256f..2a0b269 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -3694,7 +3694,7 @@ send_packet_in_miss(struct ofpbuf *packet, void *p_)
                                   ? pktbuf_get_null()
                                   : pktbuf_save(pb, &payload, msg->port));
             int send_len = (buffer_id != UINT32_MAX ? ofconn->miss_send_len
-                            : UINT32_MAX);
+                            : INT_MAX);
             do_send_packet_in(ofconn, buffer_id, packet, send_len);
         }
     }
-- 
1.6.6.1





More information about the dev mailing list