summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTakeshi <a86487817@gmail.com>2015-08-21 23:53:13 +0800
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-08-24 14:04:09 +0900
commit0d405de657c1bd7837c9a248c177f2240b98e462 (patch)
treea4acaccb710f07d4d2fc12dc6a443b5f2697aca6
parent65695e47a6cb2048ab7aa6057cc0cf8be5ce8b85 (diff)
Remove hosts from edge port when link added
Host could be added into edge port if host packet arrived before lldp packet. Signed-off-by: Takeshi <a86487817@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/topology/switches.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/ryu/topology/switches.py b/ryu/topology/switches.py
index 382e5554..af4bf80e 100644
--- a/ryu/topology/switches.py
+++ b/ryu/topology/switches.py
@@ -803,6 +803,11 @@ class Switches(app_manager.RyuApp):
if link not in self.links:
self.send_event_to_observers(event.EventLinkAdd(link))
+ # remove hosts from edge port
+ for host in self.hosts.values():
+ if self._is_edge_port(host.port):
+ del self.hosts[host.mac]
+
if not self.links.update_link(src, dst):
# reverse link is not detected yet.
# So schedule the check early because it's very likely it's up