forked from Imagelibrary/lwip
Fixed overflow in tcp_new_port() after changing port range to IANA "Dynamic and/or Private Ports" range
This commit is contained in:
@@ -619,7 +619,7 @@ tcp_new_port(void)
|
|||||||
static u16_t port = TCP_LOCAL_PORT_RANGE_START;
|
static u16_t port = TCP_LOCAL_PORT_RANGE_START;
|
||||||
|
|
||||||
again:
|
again:
|
||||||
if (++port > TCP_LOCAL_PORT_RANGE_END) {
|
if (port++ >= TCP_LOCAL_PORT_RANGE_END) {
|
||||||
port = TCP_LOCAL_PORT_RANGE_START;
|
port = TCP_LOCAL_PORT_RANGE_START;
|
||||||
}
|
}
|
||||||
/* Check all PCB lists. */
|
/* Check all PCB lists. */
|
||||||
|
|||||||
Reference in New Issue
Block a user