[openwrt/openwrt] wireguard-tools: enable reload without teardown
LEDE Commits
lede-commits at lists.infradead.org
Sun Feb 8 15:53:19 PST 2026
hauke pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/436b090bc746441a658524a84b9e35afe468ec35
commit 436b090bc746441a658524a84b9e35afe468ec35
Author: Paul Donald <newtwen+github at gmail.com>
AuthorDate: Sat Jan 31 15:52:21 2026 +0100
wireguard-tools: enable reload without teardown
- preserve (active) interface (at reload)
Signed-off-by: Paul Donald <newtwen+github at gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21784
Signed-off-by: Robert Marko <robimarko at gmail.com>
(cherry picked from commit 0a576dec7468b9d1185b383ba17ee9c7b2151a5d)
Link: https://github.com/openwrt/openwrt/pull/21840
Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
package/network/utils/wireguard-tools/files/wireguard.sh | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/package/network/utils/wireguard-tools/files/wireguard.sh b/package/network/utils/wireguard-tools/files/wireguard.sh
index e8867d65f7..738714e1c6 100644
--- a/package/network/utils/wireguard-tools/files/wireguard.sh
+++ b/package/network/utils/wireguard-tools/files/wireguard.sh
@@ -56,12 +56,10 @@ proto_wireguard_setup() {
config_get nohostroute "${config}" "nohostroute"
config_get tunlink "${config}" "tunlink"
- ip link del dev "${config}" 2>/dev/null
- ip link add dev "${config}" type wireguard
+ # Add the link only if it didn't already exist
+ ip -br link show "${config}" >/dev/null 2>&1 || ip link add dev "${config}" type wireguard
- if [ "${mtu}" ]; then
- ip link set mtu "${mtu}" dev "${config}"
- fi
+ [ -n "${mtu}" ] && ip link set mtu "${mtu}" dev "${config}"
proto_init_update "${config}" 1
More information about the lede-commits
mailing list