Fix: missing fake-ip record should return error

This commit is contained in:
Dreamacro
2020-10-17 12:52:43 +08:00
parent 8c3e2a7559
commit d3bb4c65a8
4 changed files with 30 additions and 2 deletions

View File

@ -10,6 +10,7 @@ type Enhancer interface {
FakeIPEnabled() bool
MappingEnabled() bool
IsFakeIP(net.IP) bool
IsExistFakeIP(net.IP) bool
FindHostByIP(net.IP) (string, bool)
}
@ -37,6 +38,14 @@ func IsFakeIP(ip net.IP) bool {
return false
}
func IsExistFakeIP(ip net.IP) bool {
if mapper := DefaultHostMapper; mapper != nil {
return mapper.IsExistFakeIP(ip)
}
return false
}
func FindHostByIP(ip net.IP) (string, bool) {
if mapper := DefaultHostMapper; mapper != nil {
return mapper.FindHostByIP(ip)