wireguard-tools: enable reload without teardown

- preserve (active) interface (at reload)

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21784
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 0a576dec74)
Link: https://github.com/openwrt/openwrt/pull/21840
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This commit is contained in:
Paul Donald
2026-02-09 00:47:28 +01:00
committed by Hauke Mehrtens
parent f78d9d898c
commit 436b090bc7
@@ -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