Skip to content

Commit

Permalink
Update util.go
Browse files Browse the repository at this point in the history
  • Loading branch information
kolinfluence authored Apr 6, 2023
1 parent 51192b0 commit 91bac38
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ type IpRange struct {
end net.IP
}

func ListContainsIP(ipList []net.IP, ip net.IP) uint8 {
for i := range ipList {
if bytes.Equal(ipList[i], ip) {
return 1
func ListContainsIP(ipList []*net.IPNet, ip net.IP) uint8 {
for _, block := range ipList {
if block.Contains(ip) {
return 0
}
}
return 0
return 1
}

0 comments on commit 91bac38

Please sign in to comment.