mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-22 10:58:57 +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"
|
||||
"net"
|
||||
"net/url"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"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) {
|
||||
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 {
|
||||
return internalConn{}, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user