mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-05-27 12:52:27 +02:00
Ignoring RFC 1918 addresses for ControlD upstream
This commit is contained in:
committed by
Cuong Manh Le
parent
0dee7518c4
commit
e1d078a2c3
+2
-2
@@ -177,12 +177,12 @@ func lookupIP(domain string, timeout int, withBootstrapDNS bool) (ips []string)
|
||||
ipFromRecord := func(record dns.RR, target string) string {
|
||||
switch ar := record.(type) {
|
||||
case *dns.A:
|
||||
if ar.Hdr.Name != target {
|
||||
if ar.Hdr.Name != target || len(ar.A) == 0 {
|
||||
return ""
|
||||
}
|
||||
return ar.A.String()
|
||||
case *dns.AAAA:
|
||||
if ar.Hdr.Name != target {
|
||||
if ar.Hdr.Name != target || len(ar.AAAA) == 0 {
|
||||
return ""
|
||||
}
|
||||
return ar.AAAA.String()
|
||||
|
||||
Reference in New Issue
Block a user