From c9327c9214ddec7d3882a74c742bb66f0a69d19a Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Thu, 15 Aug 2019 19:11:18 +0200 Subject: [PATCH] Let enable SQM even if no speed defined --- .../luasrc/controller/openmptcprouter.lua | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua index 1c840e5ad..768bba638 100644 --- a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua +++ b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua @@ -227,18 +227,8 @@ function wizard_add() ucic:set("network",intf,"uploadspeed",uploadspeed) ucic:set("sqm",intf,"download",math.ceil(downloadspeed*95/100)) ucic:set("sqm",intf,"upload",math.ceil(uploadspeed*95/100)) - if sqmenabled == "1" then - ucic:set("sqm",intf,"enabled","1") - else - ucic:set("sqm",intf,"enabled","0") - end ucic:set("qos",intf,"download",math.ceil(downloadspeed*95/100)) ucic:set("qos",intf,"upload",math.ceil(uploadspeed*95/100)) - if sqmenabled == "1" then - ucic:set("qos",intf,"enabled","1") - else - ucic:set("qos",intf,"enabled","0") - end else ucic:set("sqm",intf,"download","0") ucic:set("sqm",intf,"upload","0") @@ -247,6 +237,13 @@ function wizard_add() ucic:set("qos",intf,"upload","0") ucic:set("qos",intf,"enabled","0") end + if sqmenabled == "1" then + ucic:set("sqm",intf,"enabled","1") + ucic:set("qos",intf,"enabled","1") + else + ucic:set("sqm",intf,"enabled","0") + ucic:set("qos",intf,"enabled","0") + end end -- Disable multipath on LAN, VPN and loopback ucic:set("network","loopback","multipath","off")