summaryrefslogtreecommitdiff
path: root/python/vyos/ifconfig
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-03-30 19:19:54 +0200
committerChristian Poessinger <christian@poessinger.com>2022-03-30 23:10:18 +0200
commit24ffc55877ac1b791f876fd454473d0fd9ab750b (patch)
treebf7d97d26825ef6f8a2ed986d5b788f001a6d9cf /python/vyos/ifconfig
parent138d8ecd528ea0104b2194af0a1e8b330438da8f (diff)
downloadvyos-1x-24ffc55877ac1b791f876fd454473d0fd9ab750b.tar.gz
vyos-1x-24ffc55877ac1b791f876fd454473d0fd9ab750b.zip
vyos.ifconfig: T4319: add_addr() should not add IPv6 address if it's disabled
(cherry picked from commit 60f009defadb9d36bf84def1e839cb11a0b3d619)
Diffstat (limited to 'python/vyos/ifconfig')
-rw-r--r--python/vyos/ifconfig/interface.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py
index 99a06b1dd..b06fd1294 100644
--- a/python/vyos/ifconfig/interface.py
+++ b/python/vyos/ifconfig/interface.py
@@ -990,6 +990,10 @@ class Interface(Control):
"Can't configure both static IPv4 and DHCP address "
"on the same interface"))
+ # Failsave - do not add IPv6 address if IPv6 is disabled
+ if is_ipv6(addr) and not is_ipv6_enabled():
+ return False
+
# add to interface
if addr == 'dhcp':
self.set_dhcp(True)