diff options
author | Christian Breunig <christian@breunig.cc> | 2024-02-01 17:10:18 +0100 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2024-02-01 17:10:18 +0100 |
commit | e559ff4e552a0959287bee7712d887e754b25fb7 (patch) | |
tree | 5660de632f0e10430d777b8d17a346c67496713a /src | |
parent | 1bc8d96f664a92ccfd657ac645c0c329bc720359 (diff) | |
download | vyos-1x-e559ff4e552a0959287bee7712d887e754b25fb7.tar.gz vyos-1x-e559ff4e552a0959287bee7712d887e754b25fb7.zip |
bfd: T5967: add minimum-ttl option
* set protocols bfd peer <x.x.x.x> minimum-ttl <1-254>
(partially cherry-picked from 1f07dcbddfcfdbb9079936ec479c5633934dd547)
Diffstat (limited to 'src')
-rwxr-xr-x | src/conf_mode/protocols_bfd.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/conf_mode/protocols_bfd.py b/src/conf_mode/protocols_bfd.py index d1e551cad..19076068d 100755 --- a/src/conf_mode/protocols_bfd.py +++ b/src/conf_mode/protocols_bfd.py @@ -51,6 +51,7 @@ def get_bfd_peer_config(peer, conf_mode="proposed"): 'multihop': False, 'echo_interval': '', 'echo_mode': False, + 'minimum_ttl': None, } # Check if individual peer is disabled @@ -113,6 +114,12 @@ def get_bfd_peer_config(peer, conf_mode="proposed"): if conf_mode == "proposed" and conf.exists('echo-mode'): bfd_peer['echo_mode'] = True + # Enables or disables the echo transmission mode + if conf_mode == "effective" and conf.exists_effective('minimum-ttl'): + bfd_peer['minimum_ttl'] = conf.return_effective_value('minimum-ttl') + if conf_mode == "proposed" and conf.exists('minimum-ttl'): + bfd_peer['minimum_ttl'] = conf.return_value('minimum-ttl') + return bfd_peer def get_config(): @@ -173,6 +180,9 @@ def verify(bfd): if peer['echo_interval'] != '' and not peer['echo_mode']: raise ConfigError('echo-interval can be configured only with enabled echo-mode') + if peer['minimum_ttl'] != None and peer['multihop'] != True: + raise ConfigError('Minimum TTL is only available for multihop BFD sessions!') + # check if we deleted peers are not used in configuration if conf.exists('protocols bgp'): bgp_as = conf.list_nodes('protocols bgp')[0] |