fixed a panic issue caused by not checking type of input address in fake dns

This commit is contained in:
Shelikhoo
2021-04-18 23:45:51 +01:00
parent 4737a1fd5d
commit 8ba4ac15ac
+6
View File
@@ -24,6 +24,9 @@ type Holder struct {
}
func (fkdns *Holder) IsIPInIPPool(ip net.Address) bool {
if ip.Family().IsDomain() {
return false
}
return fkdns.ipRange.Contains(ip.IP())
}
@@ -139,6 +142,9 @@ type HolderMulti struct {
}
func (h *HolderMulti) IsIPInIPPool(ip net.Address) bool {
if ip.Family().IsDomain() {
return false
}
for _, v := range h.holders {
if v.IsIPInIPPool(ip) {
return true