summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-02-02 22:32:07 +0100
committerChristian Poessinger <christian@poessinger.com>2021-02-02 22:34:05 +0100
commit86209c679c6b7ca9d5bac1f67ffd391b9b16c008 (patch)
tree5f1b6757c1260cf0020ef5522f01e685f5274b57
parent3828d05afbf22915af8fc2add6fdce9b4a2ea7f4 (diff)
downloadvyos-1x-86209c679c6b7ca9d5bac1f67ffd391b9b16c008.tar.gz
vyos-1x-86209c679c6b7ca9d5bac1f67ffd391b9b16c008.zip
vlan: T3018: vif/vif-s vlan id can not be re-used
In the past it was possible to configure a vif-s interface and a vif interface both with the same VLAN ID. VyOS 1.2 reported a Kernel error: RTNETLINK answers: File exists Error creating VLAN device eth1.100 so this should not be possible at all in VyOS 1.3 (cherry picked from commit ccd516b4d10c518ea445928c01d6c7dc2770777b)
-rw-r--r--python/vyos/configverify.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/python/vyos/configverify.py b/python/vyos/configverify.py
index e54552335..fefe22175 100644
--- a/python/vyos/configverify.py
+++ b/python/vyos/configverify.py
@@ -209,6 +209,13 @@ def verify_vlan_config(config):
Common helper function used by interface implementations to perform
recurring validation of interface VLANs
"""
+
+ # VLAN and Q-in-Q IDs are not allowed to overlap
+ if 'vif' in config and 'vif_s' in config:
+ duplicate = list(set(config['vif']) & set(config['vif_s']))
+ if duplicate:
+ raise ConfigError(f'Duplicate VLAN id "{duplicate[0]}" used for vif and vif-s interfaces!')
+
# 802.1q VLANs
for vlan in config.get('vif', {}):
vlan = config['vif'][vlan]