summaryrefslogtreecommitdiff
path: root/python/vyos/ifconfig/loopback.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-04-07 19:07:52 +0200
committerChristian Poessinger <christian@poessinger.com>2022-04-07 19:54:14 +0200
commit440a7a1c965be39ca0b13b4ea5985dd9c95fabef (patch)
treea56b48ba1c45911ae250d16c711761cbb0c97a9c /python/vyos/ifconfig/loopback.py
parent0f7e5371e702d4e2389f6fa6dfbda11bc9da6257 (diff)
downloadvyos-1x-440a7a1c965be39ca0b13b4ea5985dd9c95fabef.tar.gz
vyos-1x-440a7a1c965be39ca0b13b4ea5985dd9c95fabef.zip
ipv6: T4346: delete (migrate) CLI command to disable IPv6 address family
Diffstat (limited to 'python/vyos/ifconfig/loopback.py')
-rw-r--r--python/vyos/ifconfig/loopback.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/python/vyos/ifconfig/loopback.py b/python/vyos/ifconfig/loopback.py
index 30c890fdf..b3babfadc 100644
--- a/python/vyos/ifconfig/loopback.py
+++ b/python/vyos/ifconfig/loopback.py
@@ -14,7 +14,6 @@
# License along with this library. If not, see <http://www.gnu.org/licenses/>.
from vyos.ifconfig.interface import Interface
-from vyos.util import is_ipv6_enabled
@Interface.register
class LoopbackIf(Interface):
@@ -58,15 +57,14 @@ class LoopbackIf(Interface):
interface setup code and provide a single point of entry when workin
on any interface. """
- addr = config.get('address', [])
-
+ address = config.get('address', [])
# We must ensure that the loopback addresses are never deleted from the system
- addr.append('127.0.0.1/8')
- if is_ipv6_enabled():
- addr.append('::1/128')
+ for tmp in self._persistent_addresses:
+ if tmp not in address:
+ address.append(tmp)
# Update IP address entry in our dictionary
- config.update({'address' : addr})
+ config.update({'address' : address})
# call base class
super().update(config)