peer is None if the connection comes from non configured bgp peer.
Signed-off-by: FUJITA Tomonori <[email protected]>
---
ryu/services/protocols/bgp/core.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ryu/services/protocols/bgp/core.py
b/ryu/services/protocols/bgp/core.py
index 06557cf..5388216 100644
--- a/ryu/services/protocols/bgp/core.py
+++ b/ryu/services/protocols/bgp/core.py
@@ -400,10 +400,7 @@ 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:
@@ -427,4 +424,7 @@ class CoreService(Factory, Activity):
subcode = BGP_ERROR_SUB_CONNECTION_COLLISION_RESOLUTION
bgp_proto.send_notification(code, subcode)
else:
+ bind_ip, bind_port = socket.getsockname()
+ peer._host_bind_ip = bind_ip
+ peer._host_bind_port = bind_port
self._spawn_activity(bgp_proto, peer)
--
1.8.5.2 (Apple Git-48)
------------------------------------------------------------------------------
The best possible search technologies are now affordable for all companies.
Download your FREE open source Enterprise Search Engine today!
Our experts will assist you in its installation for $59/mo, no commitment.
Test it for FREE on our Cloud platform anytime!
http://pubads.g.doubleclick.net/gampad/clk?id=145328191&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel