Fix: exclude the broadcast address to fake ip pool

This commit is contained in:
yaling888
2022-03-15 02:43:40 +08:00
parent 359f8ffca3
commit 5abd03e241
3 changed files with 43 additions and 15 deletions

View File

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