summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJernej Jakob <jernej.jakob@gmail.com>2020-05-01 20:02:34 +0200
committerJernej Jakob <jernej.jakob@gmail.com>2020-05-04 22:59:40 +0200
commit91762a9c10d3cc047c5a0938fe9827688fcdd5c0 (patch)
treecf8658bfcb2e5cd0ca33ca490bbffed8d2d6c705
parent366a53072f40f9ffbf05800787dc7faef5e489e2 (diff)
downloadvyos-1x-91762a9c10d3cc047c5a0938fe9827688fcdd5c0.tar.gz
vyos-1x-91762a9c10d3cc047c5a0938fe9827688fcdd5c0.zip
wireless: T2241: make address and bridge membership mutually exclusive
Bridge members should not have any addresses assigned.
-rwxr-xr-xsrc/conf_mode/interfaces-wireless.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/conf_mode/interfaces-wireless.py b/src/conf_mode/interfaces-wireless.py
index 319685fbd..99f5323d6 100755
--- a/src/conf_mode/interfaces-wireless.py
+++ b/src/conf_mode/interfaces-wireless.py
@@ -379,8 +379,8 @@ def get_config():
eff_addr = conf.return_effective_values('ipv6 address eui64')
wifi['ipv6_eui64_prefix_remove'] = list_diff(eff_addr, wifi['ipv6_eui64_prefix'])
- # Remove the default link-local address if set.
- if conf.exists('ipv6 address no-default-link-local'):
+ # Remove the default link-local address if set or if member of a bridge
+ if conf.exists('ipv6 address no-default-link-local') or wifi['is_bridge_member']:
wifi['ipv6_eui64_prefix_remove'].append('fe80::/64')
else:
# add the link-local by default to make IPv6 work
@@ -599,6 +599,14 @@ def verify(wifi):
if not radius['key']:
raise ConfigError('Misssing RADIUS shared secret key for server: {}'.format(radius['server']))
+ if ( wifi['is_bridge_member']
+ and ( wifi['address']
+ or wifi['ipv6_eui64_prefix']
+ or wifi['ipv6_autoconf'] ) ):
+ raise ConfigError((
+ f'Cannot assign address to interface "{wifi["intf"]}" '
+ f'as it is a member of bridge "{wifi["is_bridge_member"]}"!'))
+
if wifi['vrf']:
if wifi['vrf'] not in interfaces():
raise ConfigError(f'VRF "{wifi["vrf"]}" does not exist')