summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/vyos/configverify.py22
-rw-r--r--python/vyos/ifconfig/interface.py7
2 files changed, 15 insertions, 14 deletions
diff --git a/python/vyos/configverify.py b/python/vyos/configverify.py
index abd91583d..a888791ba 100644
--- a/python/vyos/configverify.py
+++ b/python/vyos/configverify.py
@@ -217,17 +217,17 @@ def verify_vlan_config(config):
verify_vrf(vlan)
# 802.1ad (Q-in-Q) VLANs
- for vlan in config.get('vif_s', {}):
- vlan = config['vif_s'][vlan]
- verify_dhcpv6(vlan)
- verify_address(vlan)
- verify_vrf(vlan)
-
- for vlan in config.get('vif_s', {}).get('vif_c', {}):
- vlan = config['vif_c'][vlan]
- verify_dhcpv6(vlan)
- verify_address(vlan)
- verify_vrf(vlan)
+ for s_vlan in config.get('vif_s', {}):
+ s_vlan = config['vif_s'][s_vlan]
+ verify_dhcpv6(s_vlan)
+ verify_address(s_vlan)
+ verify_vrf(s_vlan)
+
+ for c_vlan in s_vlan.get('vif_c', {}):
+ c_vlan = s_vlan['vif_c'][c_vlan]
+ verify_dhcpv6(c_vlan)
+ verify_address(c_vlan)
+ verify_vrf(c_vlan)
def verify_accel_ppp_base_service(config):
"""
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