diff options
author | Daiki Ueno <dueno@redhat.com> | 2020-11-26 09:37:03 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-11-26 23:31:42 +0100 |
commit | 0cbd5d5c4f150be7f802ec8898a37445d258cb45 (patch) | |
tree | c4d65f9c267a2e1db1efa1c4a875fd2ea9b44e08 /lib/vquic/ngtcp2.c | |
parent | 0b60d3685e4705e2c0fe4ae9aa7cea4138fbce6d (diff) | |
download | curl-0cbd5d5c4f150be7f802ec8898a37445d258cb45.tar.gz |
vquic/ngtcp2.h: define local_addr as sockaddr_storage
This field needs to be wide enough to hold sockaddr_in6 when
connecting via IPv6. Otherwise, ngtcp2_conn_read_pkt will drop the
packets because of the address mismatch:
I00000022 [...] con ignore packet from unknown path
We can safely assume that struct sockaddr_storage is available, as it
is used in the public interface of ngtcp2.
Closes #6250
Diffstat (limited to 'lib/vquic/ngtcp2.c')
-rw-r--r-- | lib/vquic/ngtcp2.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/vquic/ngtcp2.c b/lib/vquic/ngtcp2.c index c75df6310..696a5c2a5 100644 --- a/lib/vquic/ngtcp2.c +++ b/lib/vquic/ngtcp2.c @@ -828,7 +828,8 @@ CURLcode Curl_quic_connect(struct connectdata *conn, if(rv == -1) return CURLE_QUIC_CONNECT_ERROR; - ngtcp2_addr_init(&path.local, &qs->local_addr, qs->local_addrlen, NULL); + ngtcp2_addr_init(&path.local, (struct sockaddr *)&qs->local_addr, + qs->local_addrlen, NULL); ngtcp2_addr_init(&path.remote, addr, addrlen, NULL); rc = ngtcp2_conn_client_new(&qs->qconn, &qs->dcid, &qs->scid, &path, @@ -1745,7 +1746,7 @@ static CURLcode ng_process_ingress(struct connectdata *conn, return CURLE_RECV_ERROR; } - ngtcp2_addr_init(&path.local, &qs->local_addr, + ngtcp2_addr_init(&path.local, (struct sockaddr *)&qs->local_addr, qs->local_addrlen, NULL); ngtcp2_addr_init(&path.remote, (struct sockaddr *)&remote_addr, remote_addrlen, NULL); @@ -1779,7 +1780,7 @@ static CURLcode ng_flush_egress(struct connectdata *conn, int sockfd, nghttp3_vec vec[16]; ssize_t ndatalen; - switch(qs->local_addr.sa_family) { + switch(qs->local_addr.ss_family) { case AF_INET: pktlen = NGTCP2_MAX_PKTLEN_IPV4; break; |