diff options
author | Christian Breunig <christian@breunig.cc> | 2024-03-24 21:52:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-24 21:52:15 +0100 |
commit | 52f88721f78f0f8bf9e97bb23c7cebfdd3884269 (patch) | |
tree | 168308d0f5ac6db8d7cd64168e540e9ecca84e75 /src/conf_mode | |
parent | 5f02e434e62d9829e11bd5bb3ed5f6737a9ed5e1 (diff) | |
parent | 8fa9c929a3436a73110312322d45405cbb49bccb (diff) | |
download | vyos-1x-52f88721f78f0f8bf9e97bb23c7cebfdd3884269.tar.gz vyos-1x-52f88721f78f0f8bf9e97bb23c7cebfdd3884269.zip |
Merge pull request #3186 from vyos/mergify/bp/sagitta/pr-3185
ospf: T6066: can not define the same network in different areas (backport #3185)
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/protocols_ospf.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/conf_mode/protocols_ospf.py b/src/conf_mode/protocols_ospf.py index 93fc4dba6..ee29f8198 100755 --- a/src/conf_mode/protocols_ospf.py +++ b/src/conf_mode/protocols_ospf.py @@ -129,6 +129,7 @@ def verify(ospf): # Validate if configured Access-list exists if 'area' in ospf: + networks = [] for area, area_config in ospf['area'].items(): if 'import_list' in area_config: acl_import = area_config['import_list'] @@ -137,6 +138,12 @@ def verify(ospf): acl_export = area_config['export_list'] if acl_export: verify_access_list(acl_export, ospf) + if 'network' in area_config: + for network in area_config['network']: + if network in networks: + raise ConfigError(f'Network "{network}" already defined in different area!') + networks.append(network) + if 'interface' in ospf: for interface, interface_config in ospf['interface'].items(): verify_interface_exists(interface) |