summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-03-08 17:32:11 +0100
committerChristian Poessinger <christian@poessinger.com>2020-03-08 17:32:11 +0100
commit0ad41a72bde1f1a6fc538b6785ec5307a38c0233 (patch)
treed2b43b11c09928eb0eec738a62ba38d0baebff96
parentcc0a277e76d5567fc294e6847186c4be28921bf7 (diff)
downloadvyos-1x-0ad41a72bde1f1a6fc538b6785ec5307a38c0233.tar.gz
vyos-1x-0ad41a72bde1f1a6fc538b6785ec5307a38c0233.zip
ifconfig: T1557: reorder calling order to support non q-in-q interfaces
-rw-r--r--python/vyos/ifconfig_vlan.py21
1 files changed, 14 insertions, 7 deletions
diff --git a/python/vyos/ifconfig_vlan.py b/python/vyos/ifconfig_vlan.py
index 1fe955b56..1d57283ac 100644
--- a/python/vyos/ifconfig_vlan.py
+++ b/python/vyos/ifconfig_vlan.py
@@ -98,6 +98,20 @@ def verify_vlan_config(config):
implementing this function in multiple places use single source \o/
"""
+ for vif in config['vif']:
+ # DHCPv6 parameters-only and temporary address are mutually exclusive
+ if vif['dhcpv6_prm_only'] and vif['dhcpv6_temporary']:
+ raise ConfigError('DHCPv6 temporary and parameters-only options are mutually exclusive!')
+
+ vrf_name = vif['vrf']
+ if vrf_name and vrf_name not in interfaces():
+ raise ConfigError(f'VRF "{vrf_name}" does not exist')
+
+ # e.g. wireless interface has no vif_s support
+ # thus we bail out eraly.
+ if 'vif_s' not in config.keys():
+ return
+
for vif_s in config['vif_s']:
for vif in config['vif']:
if vif['id'] == vif_s['id']:
@@ -120,11 +134,4 @@ def verify_vlan_config(config):
if vrf_name and vrf_name not in interfaces():
raise ConfigError(f'VRF "{vrf_name}" does not exist')
- for vif in config['vif']:
- # DHCPv6 parameters-only and temporary address are mutually exclusive
- if vif['dhcpv6_prm_only'] and vif['dhcpv6_temporary']:
- raise ConfigError('DHCPv6 temporary and parameters-only options are mutually exclusive!')
- vrf_name = vif['vrf']
- if vrf_name and vrf_name not in interfaces():
- raise ConfigError(f'VRF "{vrf_name}" does not exist')