summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-02-26 19:06:31 +0100
committerChristian Breunig <christian@breunig.cc>2026-02-26 21:06:14 +0100
commit3cce53c83187c94e467741de20bada4edb47e932 (patch)
tree7a7befdac901b322bdd9c914828b70ce802835f7 /src
parentd7f409923cc904807f643693e193e37c4d1df8e7 (diff)
downloadvyos-1x-3cce53c83187c94e467741de20bada4edb47e932.tar.gz
vyos-1x-3cce53c83187c94e467741de20bada4edb47e932.zip
ospf: T7679: add "null" authentication option
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/protocols_ospf.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/conf_mode/protocols_ospf.py b/src/conf_mode/protocols_ospf.py
index 3f312d2cd..46023e486 100755
--- a/src/conf_mode/protocols_ospf.py
+++ b/src/conf_mode/protocols_ospf.py
@@ -102,8 +102,17 @@ def verify(config_dict):
if 'area' in ospf and 'area' in interface_config:
for area, area_config in ospf['area'].items():
if 'network' in area_config:
- raise ConfigError('Can not use OSPF interface area and area ' \
- 'network configuration at the same time!')
+ raise ConfigError('Can not use OSPF "interface area" and ' \
+ '"area network" configuration at the same time!')
+
+ # FRR only allows a single authentication mode (MD5, NULL or plaintext)
+ # at a time. Prevent users from defining more than one authentication mode.
+ if 'authentication' in interface_config:
+ auth_keys = set(interface_config['authentication'])
+ exclusive_auth_keys = {'md5', 'null', 'plaintext_password'}
+ if len(auth_keys & exclusive_auth_keys) >= 2:
+ raise ConfigError('Can not use multiple authentication modes '
+ f'simultaneously for interface "{interface}"!')
# If interface specific options are set, we must ensure that the
# interface is bound to our requesting VRF. Due to the VyOS