From d4c066a0f829538095ace126c0b3769c7b82cef9 Mon Sep 17 00:00:00 2001 From: Tata Date: Thu, 11 Apr 2019 08:50:48 +0200 Subject: [PATCH] gluon-config-mode-mesh-vpn: 0300-mesh-vpn.lua fix limit_ingress default value (#1682) in case of default disabled simple-tc for tunneldigger Signed-off-by: Jan-Tarek Butt --- .../lib/gluon/config-mode/wizard/0300-mesh-vpn.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/package/gluon-config-mode-mesh-vpn/luasrc/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua b/package/gluon-config-mode-mesh-vpn/luasrc/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua index 0fd6432b..db753f76 100644 --- a/package/gluon-config-mode-mesh-vpn/luasrc/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua +++ b/package/gluon-config-mode-mesh-vpn/luasrc/lib/gluon/config-mode/wizard/0300-mesh-vpn.lua @@ -48,10 +48,13 @@ return function(form, uci) o = s:option(Value, "limit_ingress", pkg_i18n.translate("Downstream (kbit/s)")) o:depends(limit, true) + o.default = uci:get("simple-tc", "mesh_vpn", "limit_ingress") if has_tunneldigger then - o.default = uci:get("tunneldigger", "mesh_vpn", "limit_bw_down") - else - o.default = uci:get("simple-tc", "mesh_vpn", "limit_ingress") + -- Check if limit_bw_down exists. If not, take the value from limit_ingress + local limit_bw_down = uci:get("tunneldigger", "mesh_vpn", "limit_bw_down") + if limit_bw_down ~= nil then + o.default = limit_bw_down + end end o.datatype = "uinteger" function o:write(data)