mirror of
https://github.com/faucetsdn/ryu.git
synced 2026-05-08 22:06:10 +02:00
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>
This commit is contained in:
parent
ce1c6c0c1e
commit
66759d76dd
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user