mirror of
https://github.com/faucetsdn/ryu.git
synced 2026-05-08 22:06:10 +02:00
bgp: bug fix when the peer initiated the connection.
set binded ip and port properly regardless of the direction of connection Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
2d00b7d424
commit
6da9cf0187
@ -400,7 +400,10 @@ class CoreService(Factory, Activity):
|
||||
"""
|
||||
assert socket
|
||||
peer_addr, peer_port = socket.getpeername()
|
||||
bind_ip, bind_port = socket.getsockname()
|
||||
peer = self._peer_manager.get_by_addr(peer_addr)
|
||||
peer._host_bind_ip = bind_ip
|
||||
peer._host_bind_port = bind_port
|
||||
bgp_proto = self.build_protocol(socket)
|
||||
|
||||
# We reject this connection request from peer:
|
||||
|
||||
@ -818,9 +818,6 @@ class Peer(Source, Sink, NeighborConfListener, Activity):
|
||||
client_factory,
|
||||
time_out=tcp_conn_timeout,
|
||||
bind_address=bind_addr)
|
||||
bind_ip, bind_port = sock.getpeername()
|
||||
self._host_bind_ip = bind_ip
|
||||
self._host_bind_port = bind_port
|
||||
except socket.error:
|
||||
self.state.bgp_state = const.BGP_FSM_ACTIVE
|
||||
LOG.debug('Socket could not be created in time (%s secs),'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user