summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-07-20 21:19:18 +0200
committerGitHub <noreply@github.com>2023-07-20 21:19:18 +0200
commitdb32a1e45776e1957c8c209ccc61c4079897661e (patch)
treee6fab1b43664b118ffcb4b980f1f30dae3be3a70 /src
parent8160aa1f90d93ceda2417f703344698a2e2ccbfc (diff)
parent9ec62f6511ee648a888ceb51a801a1230f4ecf1e (diff)
downloadvyos-1x-db32a1e45776e1957c8c209ccc61c4079897661e.tar.gz
vyos-1x-db32a1e45776e1957c8c209ccc61c4079897661e.zip
Merge pull request #2103 from aapostoliuk/T5328-sagitta
bgp: T5328: Fixed verifying peer without AFI.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/protocols_bgp.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/conf_mode/protocols_bgp.py b/src/conf_mode/protocols_bgp.py
index fb4a0488c..cec025fea 100755
--- a/src/conf_mode/protocols_bgp.py
+++ b/src/conf_mode/protocols_bgp.py
@@ -203,14 +203,21 @@ def verify_remote_as(peer_config, bgp_config):
return None
def verify_afi(peer_config, bgp_config):
+ # If address_family configured under neighboor
if 'address_family' in peer_config:
return True
+ # If address_family configured under peer-group
+ # if neighbor interface configured
+ peer_group_name = ''
+ if dict_search('interface.peer_group', peer_config):
+ peer_group_name = peer_config['interface']['peer_group']
+ # if neighbor IP configured.
if 'peer_group' in peer_config:
peer_group_name = peer_config['peer_group']
+ if peer_group_name:
tmp = dict_search(f'peer_group.{peer_group_name}.address_family', bgp_config)
if tmp: return True
-
return False
def verify(bgp):