From 021b672ee2f457fefb0a6d9723ac77712464200f Mon Sep 17 00:00:00 2001 From: Martin Zimmermann Date: Fri, 13 Sep 2013 16:13:45 +0200 Subject: [PATCH] use only first 3 bytes from an IPv6 address --- isso/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/isso/utils.py b/isso/utils.py index 772ecdb..77ce441 100644 --- a/isso/utils.py +++ b/isso/utils.py @@ -105,7 +105,7 @@ def anonymize(remote_addr): ip = ipaddress.ip_address(remote_addr) if ip.version == "4": return ''.join(ip.exploded.rsplit('.', 1)[0]) + '.' + '0' - return ip.exploded.rsplit(':', 4)[0] + return ip.exploded.rsplit(':', 5)[0] def salt(value, s=u'\x082@t9*\x17\xad\xc1\x1c\xa5\x98'):