summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2017-02-27 15:18:40 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-02-28 22:37:40 +0900
commit9420884db4f0b50981dc3066d24d32d1a61b9de9 (patch)
treecd9989ec6cf0b12ff7022eff667308bd4b249609
parenta1343625267cd87dd72788c25d9ce315aa92947d (diff)
hub.StreamServer: Ommit validation for IPv4 address
To support the case that user specifies the host address like 'localhost', this patch removes the validation of the given address as IPv4 address family and fixes to try listening as IPv4 by default. Then, the validation will be handled in "eventlet.listen()". This behavior is the same as that of before supporting the unix domain socket. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/lib/hub.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/ryu/lib/hub.py b/ryu/lib/hub.py
index 182fabf8..7838a0c6 100644
--- a/ryu/lib/hub.py
+++ b/ryu/lib/hub.py
@@ -112,9 +112,7 @@ if HUB_TYPE == 'eventlet':
assert backlog is None
assert spawn == 'default'
- if netaddr.valid_ipv4(listen_info[0]):
- self.server = eventlet.listen(listen_info)
- elif netaddr.valid_ipv6(listen_info[0]):
+ if netaddr.valid_ipv6(listen_info[0]):
self.server = eventlet.listen(listen_info,
family=socket.AF_INET6)
elif os.path.isdir(os.path.dirname(listen_info[0])):
@@ -122,8 +120,7 @@ if HUB_TYPE == 'eventlet':
self.server = eventlet.listen(listen_info[0],
family=socket.AF_UNIX)
else:
- raise ValueError(
- 'Invalid listen_info: %s' % str(listen_info))
+ self.server = eventlet.listen(listen_info)
if ssl_args:
def wrap_and_handle(sock, addr):