Don't assume IPv6 or IPv4 about DoH servers

This commit is contained in:
Frank Denis 2018-03-21 08:48:57 +01:00
parent 91f97833a3
commit 22f69a475a
1 changed files with 3 additions and 0 deletions

View File

@ -414,6 +414,9 @@ func (config *Config) loadSource(proxy *Proxy, requiredProps ServerInformalPrope
}
if config.SourceIPv4 || config.SourceIPv6 {
isIPv4, isIPv6 := true, false
if registeredServer.stamp.proto == StampProtoTypeDoH {
isIPv4, isIPv6 = true, true
}
if strings.HasPrefix(registeredServer.stamp.serverAddrStr, "[") {
isIPv4, isIPv6 = false, true
}