mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
Fix split mode for all protocols but DoH
In split mode, the code must check for ipv6 availability to return the correct network stack. Otherwise, we may end up using "tcp6-tls" even though the upstream IP is an ipv4.
This commit is contained in:
committed by
Cuong Manh Le
parent
d7a38363e6
commit
b471adfb09
1
dot.go
1
dot.go
@@ -33,6 +33,7 @@ func (r *dotResolver) Resolve(ctx context.Context, msg *dns.Msg) (*dns.Msg, erro
|
||||
endpoint := r.uc.Endpoint
|
||||
if r.uc.BootstrapIP != "" {
|
||||
dnsClient.TLSConfig.ServerName = r.uc.Domain
|
||||
dnsClient.Net = "tcp-tls"
|
||||
_, port, _ := net.SplitHostPort(endpoint)
|
||||
endpoint = net.JoinHostPort(r.uc.BootstrapIP, port)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user