applications/luci-splash: cope with non-numeric (invalid) limit_up & limit_down value...
[project/luci.git] / applications / luci-splash / root / usr / sbin / luci-splash
index e2bcc55..99fdd1b 100755 (executable)
@@ -11,15 +11,13 @@ local ipt = luci.sys.iptparser.IptParser()
 local splash_interfaces = { }
 local limit_up = 0
 local limit_down = 0
-local limit_down_burst = 0
 
 function main(argv)
        local cmd = argv[1]
        local arg = argv[2]
 
-       limit_up = tonumber(uci:get("luci_splash", "general", "limit_up") or 0)
-       limit_down = tonumber(uci:get("luci_splash", "general", "limit_down") or 0)
-       limit_down_burst = tonumber(uci:get("luci_splash", "general", "limit_down_burst") or limit_down * 2)
+       limit_up = tonumber(uci:get("luci_splash", "general", "limit_up")) or 0
+       limit_down = tonumber(uci:get("luci_splash", "general", "limit_down")) or 0
        
        uci:foreach("luci_splash", "iface", function(s)
                if s.network then
@@ -205,7 +203,7 @@ function sync()
                if v[".type"] == "lease" then
                        if os.difftime(time, tonumber(v.start)) > leasetime then
                                -- Remove expired
-                               remove_rule(v.mac, v.kicked)
+                               remove_rule(v.mac)
                        else
                                -- Rewrite state
                                uci:section("luci_splash", "lease", nil, {