summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-10-31 14:47:24 +0100
committerGitHub <noreply@github.com>2026-10-31 14:47:24 +0100
commitdac20a9c5bd7e49cab45a30fe211ae3be76e7fc5 (patch)
tree2eeeeed97a59bfac173c1a91fd68feebb5ef7b28 /src
parentdfd2b46ff41af4edf2fd4a2a1b9fae1efe48c145 (diff)
parent5d352d7902019469d2f87aa8fc398af2de213dee (diff)
downloadvyos-1x-dac20a9c5bd7e49cab45a30fe211ae3be76e7fc5.tar.gz
vyos-1x-dac20a9c5bd7e49cab45a30fe211ae3be76e7fc5.zip
Merge pull request #5615 from ruben-herold/T9543-ipsec-reset-default-connection-type
ipsec: T9543: start a peer again on reset when connection-type is unset
Diffstat (limited to 'src')
-rwxr-xr-xsrc/op_mode/ipsec.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/op_mode/ipsec.py b/src/op_mode/ipsec.py
index 9cb576414..43f3e25d8 100755
--- a/src/op_mode/ipsec.py
+++ b/src/op_mode/ipsec.py
@@ -666,10 +666,14 @@ def reset_peer(peer: str, tunnel: typing.Optional[str] = None) -> None:
"""
_terminate_peer(peer, tunnel)
peer_config = _get_sitetosite_peer_config(peer)
- # initiate SAs only if 'connection-type=initiate'
+ # initiate SAs only if 'connection-type=initiate', as at commit a disabled
+ # peer, a peer named '@...' or without a remote address is not started
if (
- 'connection_type' in peer_config
- and peer_config['connection_type'] == 'initiate'
+ peer_config['connection_type'] == 'initiate'
+ and 'disable' not in peer_config
+ and peer[0:1] != '@'
+ and 'remote_address' in peer_config
+ and 'any' not in peer_config['remote_address']
):
_initiate_peer_with_childsas(peer, tunnel)
@@ -1069,6 +1073,7 @@ def _get_sitetosite_peer_config(peer: str):
key_mangling=('-', '_'),
get_first_key=True,
no_tag_node_value_mangle=True,
+ with_recursive_defaults=True,
)
return peers_config