mirror of
https://github.com/v2fly/v2ray-core
synced 2024-02-27 03:18:06 +00:00
fixed a panic issue caused by not checking type of input address in fake dns
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user