From a55cf4670f02a14a8582669abacb4fdeb01c7a62 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Sat, 31 Oct 2026 12:00:00 +0100 Subject: ipsec: T9543: drop checks for an unset connection-type Since connection-type defaults to initiate, it is always present in the peer configuration. The swanctl template and the reset command still handled an unset value as a separate case, which can no longer happen. Compare against the value directly instead. The reset smoketest only checked for error messages that cannot appear, because a failed reset already aborts the test. It now verifies that reset does not start a peer that is not started at commit. --- data/templates/ipsec/swanctl/peer.j2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'data') diff --git a/data/templates/ipsec/swanctl/peer.j2 b/data/templates/ipsec/swanctl/peer.j2 index d0a51d81a..f38291866 100644 --- a/data/templates/ipsec/swanctl/peer.j2 +++ b/data/templates/ipsec/swanctl/peer.j2 @@ -41,7 +41,7 @@ {% if peer[0:1] == '@' %} keyingtries = 0 reauth_time = 0 -{% elif peer_conf.connection_type is not vyos_defined or peer_conf.connection_type is vyos_defined('initiate') %} +{% elif peer_conf.connection_type is vyos_defined('initiate') %} keyingtries = 0 {% if reauth and ike.key_exchange is vyos_defined('ikev2') %} reauth_time = {{ ike.lifetime }}s @@ -115,7 +115,7 @@ mode = {{ vti_esp.mode }} {% if peer[0:1] == '@' %} start_action = none -{% elif peer_conf.connection_type is not vyos_defined or peer_conf.connection_type is vyos_defined('initiate') %} +{% elif peer_conf.connection_type is vyos_defined('initiate') %} start_action = start {% elif peer_conf.connection_type is vyos_defined('trap') %} start_action = trap @@ -179,7 +179,7 @@ mode = {{ tunnel_esp.mode }} {% if peer[0:1] == '@' %} start_action = none -{% elif peer_conf.connection_type is not vyos_defined or peer_conf.connection_type is vyos_defined('initiate') %} +{% elif peer_conf.connection_type is vyos_defined('initiate') %} start_action = start {% elif peer_conf.connection_type is vyos_defined('trap') %} start_action = trap -- cgit v1.2.3