openvpn: Add more hotplug events
authorMichal Hrusecky <[email protected]>
Mon, 15 May 2023 12:30:29 +0000 (14:30 +0200)
committerRosen Penev <[email protected]>
Sat, 20 May 2023 09:58:33 +0000 (12:58 +0300)
OpenVPN supports more hooks than just 'up' and 'down'. Especially
reacting to 'route-up' and 'route-pre-down' events could be important.
When routing table changes, it can make sense to adapt firewall, run
some tests or change even more routes. This change passes those events
to hotplug, so it is easy to react to them without changing
configuration files provided by VPN provider.

Signed-off-by: Michal Hrusecky <[email protected]>
net/openvpn/Makefile
net/openvpn/files/openvpn.init

index fd6e7bd54b1d5809b3894f64c2c0fd305c620cc9..213f027fd5aea0430863085906e6f6bf7cf46053 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=openvpn
 
 PKG_VERSION:=2.5.8
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_URL:=\
        https://build.openvpn.net/downloads/releases/ \
index 380b423495cc3d9564aa26fd5d748a8457108685..b5f612e46b974444207eb60b509b0081b2515abb 100644 (file)
@@ -153,6 +153,9 @@ openvpn_add_instance() {
                --config "$conf" \
                --up "/usr/libexec/openvpn-hotplug up $name" \
                --down "/usr/libexec/openvpn-hotplug down $name" \
+               --route-up "/usr/libexec/openvpn-hotplug route-up $name" \
+               --route-pre-down "/usr/libexec/openvpn-hotplug route-pre-down $name" \
+               --ipchange "/usr/libexec/openvpn-hotplug ipchange $name" \
                ${up:+--setenv user_up "$up"} \
                ${down:+--setenv user_down "$down"} \
                --script-security "${security:-2}" \