From: Felix Fietkau Date: Tue, 11 Mar 2025 11:46:25 +0000 (+0100) Subject: unetd: cli: fix editing service config attributes X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=7ec11643c1a2df02a22a2cedaadeb69aff764335;p=openwrt%2Fstaging%2Fnbd.git unetd: cli: fix editing service config attributes They must be set on the config object instead of the main service object Signed-off-by: Felix Fietkau --- diff --git a/package/network/services/unetd/files/unet.uc b/package/network/services/unetd/files/unet.uc index 023ea3e6b8..06437c282c 100644 --- a/package/network/services/unetd/files/unet.uc +++ b/package/network/services/unetd/files/unet.uc @@ -937,6 +937,12 @@ function is_vxlan_service(ctx, argv, named, spec) return type == "vxlan"; } +function get_config_object(ctx, spec, obj, argv) +{ + obj.config ??= {}; + return obj.config; +} + const service_editor = { change_cb: function(ctx, argv) { ctx.data.netdata.changed = true; @@ -964,6 +970,7 @@ const service_editor = { help: "VXLAN ID", attribute: "id", available: is_vxlan_service, + get_object: get_config_object, args: { type: "int", min: 0, @@ -974,6 +981,7 @@ const service_editor = { help: "VXLAN port", attribute: "port", available: is_vxlan_service, + get_object: get_config_object, args: { type: "int", min: 1, @@ -984,6 +992,7 @@ const service_editor = { help: "VXLAN tunnel MTU", attribute: "mtu", available: is_vxlan_service, + get_object: get_config_object, args: { type: "int", min: 1280, @@ -994,6 +1003,7 @@ const service_editor = { help: "Member allowed to receive broad-/multicast and unknown unicast", attribute: "forward_ports", available: is_vxlan_service, + get_object: get_config_object, multiple: true, args: { type: "enum",