]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
sendf: fix build for Linux TCP fastopen
authorJay Satiro <raysatiro@yahoo.com>
Fri, 6 Jan 2023 19:00:59 +0000 (14:00 -0500)
committerJay Satiro <raysatiro@yahoo.com>
Sun, 8 Jan 2023 08:32:06 +0000 (03:32 -0500)
- Fix the remote addr struct dereference.

- Include cf-socket.h in urldata.h.

Follow-up to 6a8d7ef9 which changed conn->ipaddr (Curl_addrinfo* )
member to conn->remote_addr (Curl_sockaddr_ex *) several days ago.

Reported-by: Stephan Guilloux
Fixes https://github.com/curl/curl/issues/10249
Closes https://github.com/curl/curl/pull/10250

lib/sendf.c
lib/urldata.h

index 632b4f63ac458de2db56faf18196b5c7d9b3c538..a0fe27e1e768b664ee1b5128e1b813d1badbbd34 100644 (file)
@@ -363,7 +363,8 @@ ssize_t Curl_send_plain(struct Curl_easy *data, int num,
 #if defined(MSG_FASTOPEN) && !defined(TCP_FASTOPEN_CONNECT) /* Linux */
   if(conn->bits.tcp_fastopen) {
     bytes_written = sendto(sockfd, mem, len, MSG_FASTOPEN,
-                           conn->remote_addr.addr, conn->remote_addr.addrlen);
+                           &conn->remote_addr->sa_addr,
+                           conn->remote_addr->addrlen);
     conn->bits.tcp_fastopen = FALSE;
   }
   else
index 78cd0f00635d318db04e707f5d847b19fefc37cd..87e4b052a7b1ff344e2c2d5b7cf060ba1a9b7cad 100644 (file)
@@ -188,6 +188,7 @@ typedef CURLcode (*Curl_datastream)(struct Curl_easy *data,
 #include "wildcard.h"
 #include "multihandle.h"
 #include "c-hyper.h"
+#include "cf-socket.h"
 
 #ifdef HAVE_GSSAPI
 # ifdef HAVE_GSSGNU