diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-03-30 19:19:54 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2022-03-30 19:19:54 +0200 |
commit | 60f009defadb9d36bf84def1e839cb11a0b3d619 (patch) | |
tree | 177c1171e1365ab58173f88f4f2c3e840536b2fd /python/vyos/ifconfig | |
parent | c33a96f6f0f0259808992b246b1a550fcf9a454a (diff) | |
download | vyos-1x-60f009defadb9d36bf84def1e839cb11a0b3d619.tar.gz vyos-1x-60f009defadb9d36bf84def1e839cb11a0b3d619.zip |
vyos.ifconfig: T4319: add_addr() should not add IPv6 address if it's disabled
Diffstat (limited to 'python/vyos/ifconfig')
-rwxr-xr-x | python/vyos/ifconfig/interface.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py index 22265cc3c..6b9a4d03e 100755 --- a/python/vyos/ifconfig/interface.py +++ b/python/vyos/ifconfig/interface.py @@ -1083,6 +1083,10 @@ class Interface(Control): addr_is_v4 = is_ipv4(addr) + # 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) |