From 807a810049b5b17ff5e4ab661726a5858d7eae50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Kr=C3=BCger?= Date: Sun, 12 Dec 2021 10:20:37 +0100 Subject: [PATCH] mesh-openvpn: traffic shaping fixe --- .../usr/lib/lua/gluon/mesh-vpn/provider/openvpn.lua | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/package/gluon-mesh-vpn-openvpn/luasrc/usr/lib/lua/gluon/mesh-vpn/provider/openvpn.lua b/package/gluon-mesh-vpn-openvpn/luasrc/usr/lib/lua/gluon/mesh-vpn/provider/openvpn.lua index f86acbc2..3b599fc4 100755 --- a/package/gluon-mesh-vpn-openvpn/luasrc/usr/lib/lua/gluon/mesh-vpn/provider/openvpn.lua +++ b/package/gluon-mesh-vpn-openvpn/luasrc/usr/lib/lua/gluon/mesh-vpn/provider/openvpn.lua @@ -19,23 +19,16 @@ function M.active() end function M.set_limit(ingress_limit, egress_limit) - if ingress_limit ~= nil then - uci:set('openvpn', 'mesh_vpn', 'limit_bw_down', ingress_limit) - else - uci:delete('openvpn', 'mesh_vpn', 'limit_bw_down') - end - - if egress_limit ~= nil then + uci:delete('simple-tc', 'mesh_vpn') + if ingress_limit ~= nil and egress_limit ~= nil then uci:section('simple-tc', 'interface', 'mesh_vpn', { ifname = vpn_core.get_interface(), enabled = true, limit_egress = egress_limit, + limit_ingress = ingress_limit, }) - else - uci:delete('simple-tc', 'mesh_vpn') end - uci:save('openvpn') uci:save('simple-tc') end