From: Martin Pecka Date: Sun, 7 Jan 2024 22:23:57 +0000 (+0100) Subject: strongswan: Fix pools to be only generated once X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=6b824ee7d71f6c4e001a8ec41aa47d97860c9fae;p=openwrt-packages.git 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 --- diff --git a/net/strongswan/files/swanctl.init b/net/strongswan/files/swanctl.init index b081f776f..8a7e9a3ec 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 }