Skip to content
Snippets Groups Projects
Verified Commit 4f7e6ba7 authored by Richard Muzik's avatar Richard Muzik Committed by Michal Hrusecky
Browse files
parent 2c4c7c7c
Branches
Tags
1 merge request!634patches/packages/openvpn: Add more hotplug events
Pipeline #120138 passed with stages
in 8 minutes and 21 seconds
From 808f67d6152fcac09dcda4d66e2bb285878fb3d4 Mon Sep 17 00:00:00 2001
From: Ivan Pavlov <AuthorReflex@gmail.com>
Date: Wed, 7 Jun 2023 20:58:42 +0300
Subject: [PATCH] openvpn: fix ipchange hotplug event
In f8a8b71e26b9bdbf86fbb7d4d1482637af7f3ba4 openvpn introduced new hotplug events.
For server config, ipchange hotplug event produces an error.
So, make ipchange hotplug event for client only
Fixes https://github.com/openwrt/packages/issues/21200
Signed-off-by: Ivan Pavlov <AuthorReflex@gmail.com>
---
net/openvpn/Makefile | 2 +-
net/openvpn/files/openvpn.init | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/net/openvpn/Makefile b/net/openvpn/Makefile
index 213f027fd..ac76841b8 100644
--- a/net/openvpn/Makefile
+++ b/net/openvpn/Makefile
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=openvpn
PKG_VERSION:=2.5.3
-PKG_RELEASE:=4
+PKG_RELEASE:=5
PKG_SOURCE_URL:=\
https://build.openvpn.net/downloads/releases/ \
diff --git a/net/openvpn/files/openvpn.init b/net/openvpn/files/openvpn.init
index b5f612e46..6eb305135 100644
--- a/net/openvpn/files/openvpn.init
+++ b/net/openvpn/files/openvpn.init
@@ -140,10 +140,11 @@ openvpn_get_credentials() {
openvpn_add_instance() {
local name="$1"
local dir="$2"
- local conf="$3"
+ local conf=$(basename "$3")
local security="$4"
local up="$5"
local down="$6"
+ local client=$(grep -qEx "client|tls-client" "$dir/$conf" && echo 1)
procd_open_instance "$name"
procd_set_param command "$PROG" \
@@ -155,7 +156,7 @@ openvpn_add_instance() {
--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" \
+ ${client:+--ipchange "/usr/libexec/openvpn-hotplug ipchange $name"} \
${up:+--setenv user_up "$up"} \
${down:+--setenv user_down "$down"} \
--script-security "${security:-2}" \
--
2.43.0
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment