From 276ff6752a03fd2c4c644edafd81f85a76becc8a Mon Sep 17 00:00:00 2001
From: Chia-Lin Cho <fox91119@gmail.com>
Date: Mon, 4 Jan 2016 22:59:59 +0800
Subject: [PATCH] Remove old link when link updates

Signed-off-by: Chia-Lin Cho <fox91119@gmail.com>
---
 ryu/topology/switches.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ryu/topology/switches.py b/ryu/topology/switches.py
index 5fe5d26..9622a90 100644
--- a/ryu/topology/switches.py
+++ b/ryu/topology/switches.py
@@ -798,6 +798,7 @@ class Switches(app_manager.RyuApp):
         # LOG.debug("  old_peer=%s", old_peer)
         if old_peer and old_peer != dst:
             old_link = Link(src, old_peer)
+            del self.links[old_link]
             self.send_event_to_observers(event.EventLinkDelete(old_link))
 
         link = Link(src, dst)
-- 
1.9.5 (Apple Git-50.3)

