From: Matt Joiner Date: Mon, 1 Dec 2014 09:27:11 +0000 (-0600) Subject: Block IPv6 for now X-Git-Tag: v1.0.0~1466 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=54ea32ddc43fd04eef6f45aa55d98c3d9c565dfc;p=btrtrc.git Block IPv6 for now --- 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 }