修复net_socket.c动态端口溢出检查:uint16_t>65535恒假改为==0
This commit is contained in:
@@ -436,7 +436,7 @@ int net_bind(int sockfd, const struct net_sockaddr *addr, int addrlen) {
|
|||||||
if (p_sock->local_port == 0) {
|
if (p_sock->local_port == 0) {
|
||||||
p_sock->local_port = s_dynamic_port;
|
p_sock->local_port = s_dynamic_port;
|
||||||
s_dynamic_port++;
|
s_dynamic_port++;
|
||||||
if (s_dynamic_port > 65535) {
|
if (s_dynamic_port == 0) {
|
||||||
s_dynamic_port = 49152;
|
s_dynamic_port = 49152;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user