If BGPSpeaker.neighbor_del() is called, an event to notify peer down via _notify_peer_down() method will be generated. But when _notify_peer_down() method is called, peer.protocol is already cleaned up with None, so _notify_peer_down() method will fail to get the neighbor info (IP address, AS number).
This patch fixes to retrieve the neighbor info from the neighbor configuration info of Peer class and fixes this problem. Signed-off-by: IWASE Yusuke <[email protected]> --- ryu/services/protocols/bgp/bgpspeaker.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ryu/services/protocols/bgp/bgpspeaker.py b/ryu/services/protocols/bgp/bgpspeaker.py index 7e3158c..fa052fe 100644 --- a/ryu/services/protocols/bgp/bgpspeaker.py +++ b/ryu/services/protocols/bgp/bgpspeaker.py @@ -211,8 +211,8 @@ class BGPSpeaker(object): hub.spawn(ssh.SSH_CLI_CONTROLLER.start) def _notify_peer_down(self, peer): - remote_ip = peer.protocol.recv_open_msg.bgp_identifier - remote_as = peer.protocol.recv_open_msg.my_as + remote_ip = peer.ip_address + remote_as = peer.remote_as if self._peer_down_handler: self._peer_down_handler(remote_ip, remote_as) -- 2.7.4 ------------------------------------------------------------------------------ _______________________________________________ Ryu-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ryu-devel
