strongswan: don't return early for legacy UCI config

start_service() returned right after legacy_prepare_env(), so no procd
instance was created and charon was never started for legacy configs.
Continue with the normal startup flow instead and log a notice asking
users to migrate to the new schema. reload_service() now also calls
legacy_prepare_env() instead of prepare_env() for legacy configs.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
Florian Eckert authored and Florian Eckert committed 2026-11-23 12:52:50 +01:00
1 parent 897e373ea9
commit 86d116d028
1 file changed
+10 -6
+10 -6
View File
@@ -1265,7 +1265,11 @@ reload_service() {
}
running && {
prepare_env
if is_legacy_config; then
legacy_prepare_env
else
prepare_env
fi
[ $WAIT_FOR_INTF -eq 0 ] && {
# Load '/var/swanctl/swanctl.conf'
# NOTE: The command 'swanctl --load-all --noprompt'
@@ -1324,12 +1328,12 @@ start_service() {
return
}
is_legacy_config && {
if is_legacy_config; then
logger -t ipsec -p user.notice "Legacy UCI config in use, starting anyway; please migrate to the new schema."
legacy_prepare_env
return
}
prepare_env
else
prepare_env
fi
[ $WAIT_FOR_INTF -eq 1 ] && return