summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lawrence <lordsutch@gmail.com>2020-03-23 19:52:25 -0400
committerBrian May <brian@linuxpenguins.xyz>2020-03-24 16:13:33 +1100
commitee36cc0d00c43f723fea3058cd1510abdafd1804 (patch)
treed354117bf762139f1c62b51a8a6d230650cba891
parentf0c13eafe9a4ad46e0fd41c9796070dc7ef8b1a6 (diff)
Trap UnicodeError to handle cases where hostnames returned by DNS are invalid.
-rw-r--r--sshuttle/hostwatch.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/sshuttle/hostwatch.py b/sshuttle/hostwatch.py
index 87806b7..a162212 100644
--- a/sshuttle/hostwatch.py
+++ b/sshuttle/hostwatch.py
@@ -108,7 +108,7 @@ def _check_revdns(ip):
debug3('< %s\n' % r[0])
check_host(r[0])
found_host(r[0], ip)
- except socket.herror:
+ except (socket.herror, UnicodeError):
pass
@@ -119,7 +119,7 @@ def _check_dns(hostname):
debug3('< %s\n' % ip)
check_host(ip)
found_host(hostname, ip)
- except socket.gaierror:
+ except (socket.gaierror, UnicodeError):
pass