unetd: update to Git HEAD (2025-01-27)
authorFelix Fietkau <nbd@nbd.name>
Mon, 27 Jan 2025 11:43:13 +0000 (12:43 +0100)
committerFelix Fietkau <nbd@nbd.name>
Mon, 27 Jan 2025 11:43:39 +0000 (12:43 +0100)
c293afa01c13 network: add support for the local_network option

Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/network/services/unetd/Makefile
package/network/services/unetd/files/unetd.sh

index a7f030abb6c0101e43d2ffb92794f6ec0851ed26..1d47ca63ca871cea272d22c9cf5f5c21b5a1ca11 100644 (file)
@@ -10,9 +10,9 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=unetd
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/unetd.git
-PKG_SOURCE_DATE:=2025-01-26
-PKG_SOURCE_VERSION:=d13752814651c70d2afc71383612fafc835b631b
-PKG_MIRROR_HASH:=c9de65ae92af2498fcd9d55f9cd2017cb9ac79b03ed5816da21161aa24f226b9
+PKG_SOURCE_DATE:=2025-01-27
+PKG_SOURCE_VERSION:=c293afa01c1328ee8a18fc407948d0529353d7eb
+PKG_MIRROR_HASH:=f91e26cd4d4304170d99a80551691291d7920b9f4e357b0775cdeb138523ccc8
 
 PKG_LICENSE:=GPL-2.0
 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
index 2117eab391a198fab254c3fee13c769f6ec50e34..726ee765654210c4c5ad0eec78469aada511fff5 100644 (file)
@@ -18,6 +18,7 @@ proto_unet_init_config() {
        proto_config_add_string domain
        proto_config_add_boolean dht
        proto_config_add_array "tunnels:list(string)"
+       proto_config_add_array "local_network:list(string)"
        proto_config_add_array "connect:list(string)"
        proto_config_add_array "peer_data:list(string)"
        no_device=1
@@ -25,6 +26,17 @@ proto_unet_init_config() {
        no_proto_task=1
 }
 
+add_array() {
+       local name="$1"
+       local val="$2"
+
+       json_add_array "$name"
+       for c in $val; do
+               json_add_string "" "$c"
+       done
+       json_close_array
+}
+
 proto_unet_setup() {
        local config="$1"
 
@@ -33,6 +45,7 @@ proto_unet_setup() {
        json_get_values tunnels tunnels
        json_get_values connect connect
        json_get_values peer_data peer_data
+       json_get_values local_network local_network
        device="${device:-$config}"
 
        [ -n "$auth_key" ] && type="${type:-dynamic}"
@@ -58,17 +71,9 @@ proto_unet_setup() {
        done
        json_close_object
 
-       json_add_array auth_connect
-       for c in $connect; do
-               json_add_string "" "$c"
-       done
-       json_close_array
-
-       json_add_array peer_data
-       for c in $peer_data; do
-               json_add_string "" "$c"
-       done
-       json_close_array
+       add_array local_network "$local_network"
+       add_array auth_connect "$connect"
+       add_array peer_data "$peer_data"
 
        ip link del dev "$device" >/dev/null 2>&1
        ip link add dev "$device" type wireguard || {