mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-06-12 02:40:42 +00:00
fixed a panic issue caused by not checking type of input address in fake dns
This commit is contained in:
parent
4737a1fd5d
commit
8ba4ac15ac
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user