client.go | 8 ++++++++ diff --git a/client.go b/client.go index 4a6837d33f9cb958060c3415aace6d35c292171e..5d82833d16f96c3a99d9d8a4fc1910bb8214dd59 100644 --- a/client.go +++ b/client.go @@ -431,8 +431,16 @@ } me.mu.Unlock() } +var ipv6BlockRange = iplist.Range{Description: "non-IPv4 address"} + func (cl *Client) ipBlockRange(ip net.IP) (r *iplist.Range) { if cl.ipBlockList == nil { + return + } + ip = ip.To4() + if ip == nil { + log.Printf("saw non-IPv4 address") + r = &ipv6BlockRange return } r = cl.ipBlockList.Lookup(ip)