summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-12-06 19:59:33 +0100
committerChristian Poessinger <christian@poessinger.com>2021-12-06 20:01:38 +0100
commitef2242e8e5c278c201ad825f4037668c86934443 (patch)
treee997b15eb4e0962029c7d1aafc64f4e34d92755a
parent84455522574afb9286803f4e192a3d99c259618c (diff)
downloadvyos-1x-ef2242e8e5c278c201ad825f4037668c86934443.tar.gz
vyos-1x-ef2242e8e5c278c201ad825f4037668c86934443.zip
bfd: T4054: bugfix missing profile assignment to peer
-rw-r--r--data/templates/frr/bfdd.frr.tmpl3
-rwxr-xr-xsrc/conf_mode/protocols_bfd.py5
2 files changed, 8 insertions, 0 deletions
diff --git a/data/templates/frr/bfdd.frr.tmpl b/data/templates/frr/bfdd.frr.tmpl
index e0e94c24d..439f79d67 100644
--- a/data/templates/frr/bfdd.frr.tmpl
+++ b/data/templates/frr/bfdd.frr.tmpl
@@ -41,6 +41,9 @@ bfd
{% if peer_config.passive is defined %}
passive-mode
{% endif %}
+{% if peer_config.profile is defined and peer_config.profile is not none %}
+ profile {{ peer_config.profile }}
+{% endif %}
{% if peer_config.shutdown is defined %}
shutdown
{% else %}
diff --git a/src/conf_mode/protocols_bfd.py b/src/conf_mode/protocols_bfd.py
index 6981d0db1..caef61b3f 100755
--- a/src/conf_mode/protocols_bfd.py
+++ b/src/conf_mode/protocols_bfd.py
@@ -84,6 +84,11 @@ def verify(bfd):
if 'source' in peer_config and 'interface' in peer_config['source']:
raise ConfigError('Multihop and source interface cannot be used together')
+ if 'profile' in peer_config:
+ profile_name = peer_config['profile']
+ if 'profile' not in bfd or profile_name not in bfd['profile']:
+ raise ConfigError(f'BFD profile "{profile_name}" does not exist!')
+
if 'vrf' in peer_config:
verify_vrf(peer_config)