From 14b442eded3083b8a8cd5d6fbbb7d98dddd03490 Mon Sep 17 00:00:00 2001 From: Snoww <40239844+SnowSquire@users.noreply.github.com> Date: Wed, 15 Apr 2026 00:28:07 -0400 Subject: [PATCH] Align ipv6 normalizatoin logic with the typical residental allocation of /56 instead of /64. --- copyparty/util.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/copyparty/util.py b/copyparty/util.py index 9343f01d..fcae13aa 100644 --- a/copyparty/util.py +++ b/copyparty/util.py @@ -1500,9 +1500,7 @@ class Garda(object): if not self.lim: return 0, ip - if ":" in ip: - # assume /64 clients; drop 4 groups - ip = IPv6Address(ip).exploded[:-20] + ip = ipnorm(ip) if prev and self.uniq: if self.prev.get(ip) == prev: @@ -2445,8 +2443,8 @@ def odfusion( def ipnorm(ip: str) -> str: if ":" in ip: - # assume /64 clients; drop 4 groups - return IPv6Address(ip).exploded[:-20] + # assume /56 clients; drop 4 groups + return str(IPv6Network(ip + "/56", strict=False).network_address) return ip