FUJITA Tomonori <fujita.tomonori@...> writes:

> 
> On Fri, 21 Aug 2015 23:55:00 +0800
> Yi Tseng <a86487817@...> wrote:
> 
> > From ba9faae2a4937652dc7b9878f59f79bb3db01249 Mon Sep 17 00:00:00 
2001
> > From: Takeshi <a86487817@...>
> > Date: Fri, 21 Aug 2015 23:53:13 +0800
> > Subject: [PATCH] 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@...>
> > ---
> >  ryu/topology/switches.py | 5 +++++
> >  1 file changed, 5 insertions(+)
> 
> Applied, thanks.
> 
> ----------------------------------------------------------------------
--------
> 


This patch generates an error: it is not possible to modified a 
collection while iterating.
I propose this quick yet effective fix:

            # remove hosts from edge port
            to_be_deleted=[]
            for host in self.hosts.values():
                if not self._is_edge_port(host.port):
                    to_be_deleted.append(host.mac)

            for mac in to_be_deleted:
                del self.hosts[mac]

Giovanni


------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to