strongswan: trigger reload when interfaces are specified
authorJoel Low <joel@joelsplace.sg>
Thu, 14 Dec 2023 12:00:32 +0000 (20:00 +0800)
committerJoel Low <joel@joelsplace.sg>
Mon, 18 Dec 2023 02:17:09 +0000 (10:17 +0800)
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 <joel@joelsplace.sg>
net/strongswan/Makefile
net/strongswan/files/swanctl.init

index 09ae9ea8731fb76d47563f32bc5cb6de431033a0..20790d8ea75ce278e1bd9c07468466093401d8d3 100644 (file)
@@ -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/
index 289e7ff567aa17c986212fb297306426cd691f16..abdbb1ffe185ef55bec7bf8959e9261bcdfbac1e 100644 (file)
@@ -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() {