修复net_socket.c动态端口溢出检查:uint16_t>65535恒假改为==0

This commit is contained in:
2026-09-01 13:40:06 +08:00
parent 3fdfeff1fd
commit 45307363a1
+1 -1
View File
@@ -436,7 +436,7 @@ int net_bind(int sockfd, const struct net_sockaddr *addr, int addrlen) {
if (p_sock->local_port == 0) {
p_sock->local_port = s_dynamic_port;
s_dynamic_port++;
if (s_dynamic_port > 65535) {
if (s_dynamic_port == 0) {
s_dynamic_port = 49152;
}
}