mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-31 22:11:51 +00:00
Before this patch, IPv4-compatible addresses (::ffff:aaa.bbb.ccc.ddd) may be used if a quic6://some.domain:port is specified and both IPv4 and IPv6 addresses exist for that domain name.
This commit is contained in:
parent
1921533c4c
commit
11c57b9097
@ -13,6 +13,7 @@ import (
|
|||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"net"
|
"net"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/lucas-clemente/quic-go"
|
"github.com/lucas-clemente/quic-go"
|
||||||
@ -45,7 +46,9 @@ type quicDialer struct {
|
|||||||
func (d *quicDialer) Dial(ctx context.Context, _ protocol.DeviceID, uri *url.URL) (internalConn, error) {
|
func (d *quicDialer) Dial(ctx context.Context, _ protocol.DeviceID, uri *url.URL) (internalConn, error) {
|
||||||
uri = fixupPort(uri, config.DefaultQUICPort)
|
uri = fixupPort(uri, config.DefaultQUICPort)
|
||||||
|
|
||||||
addr, err := net.ResolveUDPAddr("udp", uri.Host)
|
network := strings.ReplaceAll(uri.Scheme, "quic", "udp")
|
||||||
|
|
||||||
|
addr, err := net.ResolveUDPAddr(network, uri.Host)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return internalConn{}, err
|
return internalConn{}, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user