ofproto: Maximum value of "int" is INT_MAX, not UINT32_MAX.
authorBen Pfaff <blp@nicira.com>
Fri, 9 Apr 2010 21:04:10 +0000 (14:04 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 13 Apr 2010 18:13:53 +0000 (11:13 -0700)
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@hpl.hp.com>
ofproto/ofproto.c

index 0f4ba6844a35d4d2db4134d292c3da81ec97ed16..83dc99d82b5e850474bd492a3e117b4f09f16258 100644 (file)
@@ -3702,7 +3702,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);
         }
     }