diff options
author | Toshiki Tsuboi <t.tsubo2000@gmail.com> | 2014-12-17 13:25:48 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-12-18 12:40:39 +0900 |
commit | c484d73bfbdb5b46bbb08f462bb57e65bdf09e0e (patch) | |
tree | 3baf7044e03c35010bf782432df9cc084f974c66 | |
parent | 3bfa3c56da4c6d471454103984142d9703e6a04d (diff) |
bgp: support New best path selecting
In case of selecting new best path, Ryu BGPSpeaker send withdraw messages.
Signed-off-by: Toshiki Tsuboi <t.tsubo2000@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/services/protocols/bgp/info_base/base.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ryu/services/protocols/bgp/info_base/base.py b/ryu/services/protocols/bgp/info_base/base.py index d3bc445c..8ddbb0a1 100644 --- a/ryu/services/protocols/bgp/info_base/base.py +++ b/ryu/services/protocols/bgp/info_base/base.py @@ -257,6 +257,16 @@ class NonVrfPathProcessingMixin(object): pm = self._core_service.peer_manager pm.comm_new_best_to_bgp_peers(new_best_path) + # withdraw old best path + if old_best_path and self._sent_routes: + for sent_route in self._sent_routes.values(): + sent_path = sent_route.path + withdraw_clone = sent_path.clone(for_withdrawal=True) + outgoing_route = OutgoingRoute(withdraw_clone) + sent_route.sent_peer.enque_outgoing_msg(outgoing_route) + LOG.debug('Sending withdrawal to %s for %s' % + (sent_route.sent_peer, outgoing_route)) + class Destination(object): """State about a particular destination. |