From f2d209e4fff3048883ee5953c3a312d9f5aaab1b Mon Sep 17 00:00:00 2001 From: Joel Low Date: Thu, 14 Dec 2023 20:00:32 +0800 Subject: [PATCH] strongswan: trigger reload when interfaces are specified Fixes #20848 Add interface triggers if interfaces to listen to are specified in `/etc/config/ipsec`. This fixes the "running with no instances" scenario after rebooting a router. Signed-off-by: Joel Low --- net/strongswan/Makefile | 2 +- net/strongswan/files/swanctl.init | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/net/strongswan/Makefile b/net/strongswan/Makefile index 09ae9ea873..20790d8ea7 100644 --- a/net/strongswan/Makefile +++ b/net/strongswan/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=strongswan PKG_VERSION:=5.9.13 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://download.strongswan.org/ https://download2.strongswan.org/ diff --git a/net/strongswan/files/swanctl.init b/net/strongswan/files/swanctl.init index 289e7ff567..abdbb1ffe1 100644 --- a/net/strongswan/files/swanctl.init +++ b/net/strongswan/files/swanctl.init @@ -712,6 +712,16 @@ stop_service() { service_triggers() { procd_add_reload_trigger "ipsec" config load "ipsec" + + config_foreach service_trigger_ipsec ipsec +} + +service_trigger_ipsec() { + local interface interface_list + config_list_foreach "$1" interface append_var interface_list + for interface in $interface_list; do + procd_add_reload_interface_trigger $interface + done } start_service() { -- 2.30.2