summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-04-23 11:55:07 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-04-24 07:32:06 +0900
commit66759d76ddb74e3ea0ea03ddc8b6f81b70178528 (patch)
tree7ace06dff35d84a93b74dec7c57dbc8b5434c675
parentce1c6c0c1ec9da0ed7439d1698750c0a821d21e2 (diff)
bgp: fix connect timeout error
RROR 2014-04-23 11:54:59,239 hub 58 hub: uncaught exception: Traceback (most recent c\ all last): File "/Users/fujita/git/ryu/ryu/lib/hub.py", line 50, in _launch func(*args, **kwargs) File "/Users/fujita/git/ryu/ryu/services/protocols/bgp/base.py", line 239, in start self._run(*args, **kwargs) File "/Users/fujita/git/ryu/ryu/services/protocols/bgp/peer.py", line 448, in _run self._connect_loop(client_factory) File "/Users/fujita/git/ryu/ryu/services/protocols/bgp/peer.py", line 820, in _conne\ ct_loop bind_address=bind_addr) File "/Users/fujita/git/ryu/ryu/services/protocols/bgp/base.py", line 354, in _conne\ ct_tcp return sock UnboundLocalError: local variable 'sock' referenced before assignment Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/services/protocols/bgp/base.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/ryu/services/protocols/bgp/base.py b/ryu/services/protocols/bgp/base.py
index 571826f5..9eff703a 100644
--- a/ryu/services/protocols/bgp/base.py
+++ b/ryu/services/protocols/bgp/base.py
@@ -17,6 +17,7 @@
"""
import abc
import logging
+import socket
import time
import traceback
import weakref
@@ -340,7 +341,7 @@ class Activity(object):
"""
LOG.debug('Connect TCP called for %s:%s' % (peer_addr[0],
peer_addr[1]))
- with Timeout(time_out, False):
+ with Timeout(time_out, socket.error):
sock = hub.connect(peer_addr, bind=bind_address)
if sock:
# Connection name for pro-active connection is made up