diff options
author | Christian Breunig <christian@breunig.cc> | 2024-03-24 21:06:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-24 21:06:11 +0100 |
commit | 7c0be25eea90cf9324e421b6c2dfda9bda2ecb7e (patch) | |
tree | 3dcca848fda230bb9f636858fa66b11949d125ab /src | |
parent | d379dab2b9ae9490b45a2d42b319871258392385 (diff) | |
parent | c6d8d9c012da1a7566eec2dff70385457f073e64 (diff) | |
download | vyos-1x-7c0be25eea90cf9324e421b6c2dfda9bda2ecb7e.tar.gz vyos-1x-7c0be25eea90cf9324e421b6c2dfda9bda2ecb7e.zip |
Merge pull request #3185 from c-po/ospf-T6066
ospf: T6066: can not define the same network in different areas
Diffstat (limited to 'src')
-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 695842795..6fffe7e0d 100755 --- a/src/conf_mode/protocols_ospf.py +++ b/src/conf_mode/protocols_ospf.py @@ -127,6 +127,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'] @@ -135,6 +136,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) |