From 0d405de657c1bd7837c9a248c177f2240b98e462 Mon Sep 17 00:00:00 2001 From: Takeshi Date: Fri, 21 Aug 2015 23:53:13 +0800 Subject: 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 Signed-off-by: FUJITA Tomonori --- ryu/topology/switches.py | 5 +++++ 1 file changed, 5 insertions(+) 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 -- cgit v1.2.3