summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-01-12 17:20:23 +0100
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-01-12 16:25:45 +0000
commit6c6dae767c2485e9b77f33f58bfc4e84dffa03a8 (patch)
tree433aa7a8c8ec32fe700e4f40055215302ba84ffb /src
parent0689c2752eba7bd6051e174831a70b85d4ffecf8 (diff)
downloadvyos-1x-6c6dae767c2485e9b77f33f58bfc4e84dffa03a8.tar.gz
vyos-1x-6c6dae767c2485e9b77f33f58bfc4e84dffa03a8.zip
bgp: T5306: fix verify_remote_as() to support v6only interface with peer-group
To test: set protocols bgp neighbor eth0 interface v6only peer-group 'fabric' set protocols bgp peer-group fabric address-family ipv4-unicast set protocols bgp peer-group fabric address-family ipv6-unicast set protocols bgp peer-group fabric capability extended-nexthop set protocols bgp peer-group fabric remote-as 'external' set protocols bgp system-as 64496 (cherry picked from commit 12e81dbb47b942b3d9a7a69189adefb5b176c4ef)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/protocols_bgp.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/conf_mode/protocols_bgp.py b/src/conf_mode/protocols_bgp.py
index bf807fa5f..89e2aab8c 100755
--- a/src/conf_mode/protocols_bgp.py
+++ b/src/conf_mode/protocols_bgp.py
@@ -206,6 +206,10 @@ def verify_remote_as(peer_config, bgp_config):
if 'v6only' in peer_config['interface']:
if 'remote_as' in peer_config['interface']['v6only']:
return peer_config['interface']['v6only']['remote_as']
+ if 'peer_group' in peer_config['interface']['v6only']:
+ peer_group_name = peer_config['interface']['v6only']['peer_group']
+ tmp = dict_search(f'peer_group.{peer_group_name}.remote_as', bgp_config)
+ if tmp: return tmp
return None