summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ryu/topology/switches.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/ryu/topology/switches.py b/ryu/topology/switches.py
index 9622a903..e21f00eb 100644
--- a/ryu/topology/switches.py
+++ b/ryu/topology/switches.py
@@ -206,10 +206,14 @@ class HostState(dict):
if not host:
return
- if ip_v4 != None and ip_v4 not in host.ipv4:
+ if ip_v4 != None:
+ if ip_v4 in host.ipv4:
+ host.ipv4.remove(ip_v4)
host.ipv4.append(ip_v4)
- if ip_v6 != None and ip_v6 not in host.ipv6:
+ if ip_v6 != None:
+ if ip_v6 in host.ipv6:
+ host.ipv6.remove(ip_v6)
host.ipv6.append(ip_v6)
def get_by_dpid(self, dpid):