From 4372c6c11739eb479ffb74f933699960686c9408 Mon Sep 17 00:00:00 2001 From: Thomas Bouve Date: Wed, 13 Feb 2019 20:01:09 +0100 Subject: [PATCH] Hyphen in hostname fix --- sshuttle/options.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sshuttle/options.py b/sshuttle/options.py index df01989..a19d5ef 100644 --- a/sshuttle/options.py +++ b/sshuttle/options.py @@ -32,7 +32,7 @@ def parse_subnetport(s): if s.count(':') > 1: rx = r'(?:\[?([\w\:]+)(?:/(\d+))?]?)(?::(\d+)(?:-(\d+))?)?$' else: - rx = r'([\w\.]+)(?:/(\d+))?(?::(\d+)(?:-(\d+))?)?$' + rx = r'([\w\.\-]+)(?:/(\d+))?(?::(\d+)(?:-(\d+))?)?$' m = re.match(rx, s) if not m: @@ -63,7 +63,7 @@ def parse_ipport(s): elif ']' in s: rx = r'(?:\[([^]]+)])(?::(\d+))?$' else: - rx = r'([\w\.]+)(?::(\d+))?$' + rx = r'([\w\.\-]+)(?::(\d+))?$' m = re.match(rx, s) if not m: