]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
ngtcp2: adjust to recent sockaddr updates
authorDaniel Stenberg <daniel@haxx.se>
Thu, 16 Jul 2020 19:00:25 +0000 (21:00 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 16 Jul 2020 21:56:42 +0000 (23:56 +0200)
Closes #5690

lib/vquic/ngtcp2.c
lib/vquic/ngtcp2.h

index 7c27b4dbc9959b94ac9c931c0af2cfc19a30fdbf..d76329f980f8a512ee7c7d39117935eef87a3448 100644 (file)
@@ -828,9 +828,8 @@ CURLcode Curl_quic_connect(struct connectdata *conn,
   if(rv == -1)
     return CURLE_QUIC_CONNECT_ERROR;
 
-  ngtcp2_addr_init(&path.local, (uint8_t *)&qs->local_addr, qs->local_addrlen,
-                   NULL);
-  ngtcp2_addr_init(&path.remote, (uint8_t*)addr, addrlen, NULL);
+  ngtcp2_addr_init(&path.local, &qs->local_addr, qs->local_addrlen, NULL);
+  ngtcp2_addr_init(&path.remote, addr, addrlen, NULL);
 
 #ifdef NGTCP2_PROTO_VER
 #define QUICVER NGTCP2_PROTO_VER
@@ -1726,7 +1725,7 @@ static CURLcode ng_process_ingress(struct connectdata *conn, int sockfd,
   int rv;
   uint8_t buf[65536];
   size_t bufsize = sizeof(buf);
-  struct sockaddr_storage remote_addr;
+  struct sockaddr remote_addr;
   socklen_t remote_addrlen;
   ngtcp2_path path;
   ngtcp2_tstamp ts = timestamp();
@@ -1746,10 +1745,9 @@ static CURLcode ng_process_ingress(struct connectdata *conn, int sockfd,
       return CURLE_RECV_ERROR;
     }
 
-    ngtcp2_addr_init(&path.local, (uint8_t *)&qs->local_addr,
+    ngtcp2_addr_init(&path.local, &qs->local_addr,
                      qs->local_addrlen, NULL);
-    ngtcp2_addr_init(&path.remote, (uint8_t *)&remote_addr, remote_addrlen,
-                     NULL);
+    ngtcp2_addr_init(&path.remote, &remote_addr, remote_addrlen, NULL);
 
     rv = ngtcp2_conn_read_pkt(qs->qconn, &path, buf, recvd, ts);
     if(rv != 0) {
@@ -1780,7 +1778,7 @@ static CURLcode ng_flush_egress(struct connectdata *conn, int sockfd,
   nghttp3_vec vec[16];
   ssize_t ndatalen;
 
-  switch(qs->local_addr.ss_family) {
+  switch(qs->local_addr.sa_family) {
   case AF_INET:
     pktlen = NGTCP2_MAX_PKTLEN_IPV4;
     break;
index e2f8b56001602205336921e72adb257b6327a585..afdd01b7c21f3cf28d52a77c9b03858fc5991453 100644 (file)
@@ -58,7 +58,7 @@ struct quicsocket {
   struct quic_handshake crypto_data[3];
   /* the last TLS alert description generated by the local endpoint */
   uint8_t tls_alert;
-  struct sockaddr_storage local_addr;
+  struct sockaddr local_addr;
   socklen_t local_addrlen;
 
   nghttp3_conn *h3conn;