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 <peci1@seznam.cz>
Signed-off-by: Martin Pecka <peckama2@fel.cvut.cz>
This commit is contained in:
Martin Pecka 2024-01-07 23:23:57 +01:00 committed by Philip Prindeville
parent 4b9453b9a4
commit 6b824ee7d7
1 changed files with 4 additions and 4 deletions

View File

@ -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
}