From 6b824ee7d71f6c4e001a8ec41aa47d97860c9fae Mon Sep 17 00:00:00 2001 From: Martin Pecka Date: Sun, 7 Jan 2024 23:23:57 +0100 Subject: [PATCH] strongswan: Fix pools to be only generated once Before this commit, if a user configures multiple remotes in UCI, each remote generates one output section of pools. This doesn't hurt because swanctl just merges all of them, but it is apparently not needed to have N copies of the same. This commit changes the behavior to only create one pools section at the end of the generated swanctl config. Signed-off-by: Martin Pecka Signed-off-by: Martin Pecka --- net/strongswan/files/swanctl.init | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/strongswan/files/swanctl.init b/net/strongswan/files/swanctl.init index b081f776f0..8a7e9a3ec5 100644 --- a/net/strongswan/files/swanctl.init +++ b/net/strongswan/files/swanctl.init @@ -610,10 +610,6 @@ config_remote() { fatal "AuthenticationMode $auth_mode not supported" fi - swanctl_xappend0 "pools {" - config_list_foreach "$conf" pools config_pool - swanctl_xappend0 "}" - swanctl_xappend0 "" } @@ -689,6 +685,10 @@ prepare_env() { config_load ipsec config_foreach config_ipsec ipsec config_foreach config_remote remote + + swanctl_xappend0 "pools {" + config_foreach config_pool pools + swanctl_xappend0 "}" do_postamble } -- 2.30.2