From d974065f8ef353b7ec3c91ac9c4962f74b763912 Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Thu, 23 Feb 2017 20:22:44 +0200 Subject: [PATCH] Handle exceptions from python without ipv6 support --- src/protocol.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/protocol.py b/src/protocol.py index e5b2c5c2..dca4c942 100644 --- a/src/protocol.py +++ b/src/protocol.py @@ -100,7 +100,10 @@ def checkIPAddress(host, private=False): return False return hostStandardFormat else: - hostStandardFormat = socket.inet_ntop(socket.AF_INET6, host) + try: + hostStandardFormat = socket.inet_ntop(socket.AF_INET6, host) + except ValueError: + return False if hostStandardFormat == "": # This can happen on Windows systems which are not 64-bit compatible # so let us drop the IPv6 address.