summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces-pseudo-ethernet.py
diff options
context:
space:
mode:
authorJernej Jakob <jernej.jakob@gmail.com>2020-05-01 19:44:17 +0200
committerJernej Jakob <jernej.jakob@gmail.com>2020-05-04 22:59:39 +0200
commit50ca89433c2a29367a36f5f049821a9bedb39d24 (patch)
treea61a4943b36e00b8c69c1247b117aa83b02121ea /src/conf_mode/interfaces-pseudo-ethernet.py
parentf11ce49a670507f814183e27c4f3e50e29e54e6e (diff)
downloadvyos-1x-50ca89433c2a29367a36f5f049821a9bedb39d24.tar.gz
vyos-1x-50ca89433c2a29367a36f5f049821a9bedb39d24.zip
pseudo-ethernet: T2241: make address and bridge membership mutually exclusive
Bridge members should not have any addresses assigned.
Diffstat (limited to 'src/conf_mode/interfaces-pseudo-ethernet.py')
-rwxr-xr-xsrc/conf_mode/interfaces-pseudo-ethernet.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/conf_mode/interfaces-pseudo-ethernet.py b/src/conf_mode/interfaces-pseudo-ethernet.py
index 9f01cf0c1..e06f14a95 100755
--- a/src/conf_mode/interfaces-pseudo-ethernet.py
+++ b/src/conf_mode/interfaces-pseudo-ethernet.py
@@ -122,6 +122,14 @@ def verify(peth):
if not peth['source_interface'] in interfaces():
raise ConfigError('Pseudo-ethernet source-interface does not exist')
+ if ( peth['is_bridge_member']
+ and ( peth['address']
+ or peth['ipv6_eui64_prefix']
+ or peth['ipv6_autoconf'] ) ):
+ raise ConfigError((
+ f'Cannot assign address to interface "{peth["intf"]}" '
+ f'as it is a member of bridge "{peth["is_bridge_member"]}"!'))
+
if peth['vrf']:
if peth['vrf'] not in interfaces():
raise ConfigError(f'VRF "{peth["vrf"]}" does not exist')