Fixed overflow in tcp_new_port() after changing port range to IANA "Dynamic and/or Private Ports" range

This commit is contained in:
goldsimon 2011-04-29 11:23:04 +00:00
parent 80b344e9fc
commit e4739da961

View File

@ -619,7 +619,7 @@ tcp_new_port(void)
static u16_t port = TCP_LOCAL_PORT_RANGE_START;
again:
if (++port > TCP_LOCAL_PORT_RANGE_END) {
if (port++ >= TCP_LOCAL_PORT_RANGE_END) {
port = TCP_LOCAL_PORT_RANGE_START;
}
/* Check all PCB lists. */