From b6cdfd39d368251ea1b1913c1580b7a3c335ff78 Mon Sep 17 00:00:00 2001 From: Nikolay Shopik Date: Tue, 9 May 2017 23:56:16 +0300 Subject: [PATCH] detect and ignore teredo/6to4 --- blockcheck.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/blockcheck.py b/blockcheck.py index 05f5cb6..32c43ab 100755 --- a/blockcheck.py +++ b/blockcheck.py @@ -781,8 +781,11 @@ def check_ipv6_availability(): if (v6addr): v6 = _get_url("http://ipv6.icanhazip.com/", ip=v6addr[0]) if len(v6[1]): - print(": IPv6 доступен!") - return v6[1].strip() + v6src = v6[1].strip() + if (ipaddress.IPv6Address(v6src).teredo == None and + ipaddress.IPv6Address(v6src).sixtofour == None): + print(": IPv6 доступен! (Teredo/6to4 игнорируем)") + return v6src print(": IPv6 недоступен.") return False