summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2023-08-17 13:43:03 +0100
committerGitHub <noreply@github.com>2023-08-17 13:43:03 +0100
commitdcb02916dddeb6cc8e898a7df839cc78c67984ff (patch)
tree404193aa4df4208e940b82469fb877661d9ac506
parent616bdb5299bf8252dfdab26f21a4b356cff6724e (diff)
parent477c2def5fb4a3daab2ffa2a6f5808b69e0ad9fe (diff)
downloadvyos-1x-dcb02916dddeb6cc8e898a7df839cc78c67984ff.tar.gz
vyos-1x-dcb02916dddeb6cc8e898a7df839cc78c67984ff.zip
Merge pull request #2153 from sever-sever/T5223
T5223: Fix removing key id for GRE tunnel
-rwxr-xr-xsrc/conf_mode/interfaces-tunnel.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/conf_mode/interfaces-tunnel.py b/src/conf_mode/interfaces-tunnel.py
index 681caff8e..d3a486549 100755
--- a/src/conf_mode/interfaces-tunnel.py
+++ b/src/conf_mode/interfaces-tunnel.py
@@ -54,6 +54,9 @@ def get_config(config=None):
tmp = leaf_node_changed(conf, ['encapsulation'])
if tmp: tunnel.update({'encapsulation_changed': {}})
+ tmp = leaf_node_changed(conf, ['parameters', 'ip', 'key'])
+ if tmp: tunnel.update({'key_changed': {}})
+
# We also need to inspect other configured tunnels as there are Kernel
# restrictions where we need to comply. E.g. GRE tunnel key can't be used
# twice, or with multiple GRE tunnels to the same location we must specify
@@ -174,8 +177,9 @@ def apply(tunnel):
encap = dict_search('linkinfo.info_kind', tmp)
remote = dict_search('linkinfo.info_data.remote', tmp)
- if ('deleted' in tunnel or 'encapsulation_changed' in tunnel or encap in
- ['gretap', 'ip6gretap'] or remote in ['any']):
+ if ('deleted' in tunnel or 'encapsulation_changed' in tunnel or
+ encap in ['gretap', 'ip6gretap'] or remote in ['any'] or
+ 'key_changed' in tunnel):
if interface in interfaces():
tmp = Interface(interface)
tmp.remove()