summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorBrandon Stepler <brandon@stepler.net>2021-01-27 15:00:00 -0500
committerBrandon Stepler <brandon@stepler.net>2021-01-27 15:00:00 -0500
commitd7d916f74e7d3b3b1fc85336f24f91af66b1e2a8 (patch)
tree6993f297cfd4e22f01a0f3fc1eb7f83e9f23d383 /python
parent1b607b956b62e2a005077e9a103546423b87da49 (diff)
downloadvyos-1x-d7d916f74e7d3b3b1fc85336f24f91af66b1e2a8.tar.gz
vyos-1x-d7d916f74e7d3b3b1fc85336f24f91af66b1e2a8.zip
dhcpv6: T3262: don't run DHCPv6 client when only dhcpv6-options is configured
If dhcpv6-options is configured without requesting a DHCPv6 address or PD, the dhcpv6pd variable is assigned an empty dict.
Diffstat (limited to 'python')
-rw-r--r--python/vyos/ifconfig/interface.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py
index 3b92ce463..8528c4a81 100644
--- a/python/vyos/ifconfig/interface.py
+++ b/python/vyos/ifconfig/interface.py
@@ -1102,9 +1102,10 @@ class Interface(Control):
self.del_addr('dhcp')
# always ensure DHCPv6 client is stopped (when not configured as client
- # for IPv6 address or prefix delegation
+ # for IPv6 address or prefix delegation)
dhcpv6pd = dict_search('dhcpv6_options.pd', config)
- if 'dhcpv6' not in new_addr or dhcpv6pd == None:
+ dhcpv6pd = dhcpv6pd != None and len(dhcpv6pd) != 0
+ if 'dhcpv6' not in new_addr and not dhcpv6pd:
self.del_addr('dhcpv6')
# determine IP addresses which are assigned to the interface and build a
@@ -1124,7 +1125,7 @@ class Interface(Control):
self.add_addr(addr)
# start DHCPv6 client when only PD was configured
- if dhcpv6pd != None:
+ if dhcpv6pd:
self.set_dhcpv6(True)
# There are some items in the configuration which can only be applied