← Commit list

d27d9c7ef1

Daniel Stenberg
Daniel Stenberg
2025-09-20
FAILED Duration: 151s

Subject

cf-socket: use the right byte order for ports in bindlocal

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/cf-socket.c+2 -2
@@ -790,10 +790,10 @@ static CURLcode bindlocal(struct Curl_easy *data, struct connectdata *conn,
infof(data, "Bind to local port %d failed, trying next", port - 1);
/* We reuse/clobber the port variable here below */
if(sock->sa_family == AF_INET)
- si4->sin_port = ntohs(port);
+ si4->sin_port = htons(port);
#ifdef USE_IPV6
else
- si6->sin6_port = ntohs(port);
+ si6->sin6_port = htons(port);
#endif
}
else