summaryrefslogtreecommitdiff
path: root/python/vyos/ifconfig.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-09-15 16:02:50 +0200
committerChristian Poessinger <christian@poessinger.com>2019-09-20 21:28:53 +0200
commit879036a4db0517dc332c4e2ce3c806495a5fe401 (patch)
tree241368d9dd8aa495d2279e6a1fb42614dd7f465f /python/vyos/ifconfig.py
parent738b62f0fb410daf1dbe97ad8aed9d862b44ec94 (diff)
downloadvyos-1x-879036a4db0517dc332c4e2ce3c806495a5fe401.tar.gz
vyos-1x-879036a4db0517dc332c4e2ce3c806495a5fe401.zip
Python/ifconfig: T1557: delete all assigned IP addresses on remove()
Diffstat (limited to 'python/vyos/ifconfig.py')
-rw-r--r--python/vyos/ifconfig.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/python/vyos/ifconfig.py b/python/vyos/ifconfig.py
index c0d1660d1..4bb320e21 100644
--- a/python/vyos/ifconfig.py
+++ b/python/vyos/ifconfig.py
@@ -129,6 +129,12 @@ class Interface:
self._del_dhcp()
self._del_dhcpv6()
+ # remove all assigned IP addresses from interface - this is a bit redundant
+ # as the kernel will remove all addresses on interface deletion, but we
+ # can not delete ALL interfaces, see below
+ for addr in self.get_addr():
+ self.del_addr(addr)
+
# Ethernet interfaces can not be removed
if type(self) == type(EthernetIf(self._ifname)):
return