mirror of
https://github.com/curl/curl.git
synced 2026-07-23 12:17:15 +03:00
cf-socket: use the right byte order for ports in bindlocal
Reported in Joshua's sarif data Closes #18641
This commit is contained in:
parent
94eec0a788
commit
d27d9c7ef1
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue