From 54ea32ddc43fd04eef6f45aa55d98c3d9c565dfc Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Mon, 1 Dec 2014 03:27:11 -0600 Subject: [PATCH] Block IPv6 for now --- client.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client.go b/client.go index 4a6837d3..5d82833d 100644 --- a/client.go +++ b/client.go @@ -431,10 +431,18 @@ func (me *Client) Stop() { 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) return } -- 2.48.1