diff options
author | Manuel Munz <freifunk@somakoma.de> | 2013-10-16 23:51:43 +0000 |
---|---|---|
committer | Manuel Munz <freifunk@somakoma.de> | 2013-10-16 23:51:43 +0000 |
commit | 4ae0d30edd7a55352828afc8a45e20a581d22440 (patch) | |
tree | 9fce870f74e9445f15664895ae1ee712f27b2c9a /applications | |
parent | e966cfea23740e36f94c359506e7412da38af4fd (diff) |
applications/luci-splash: Fix a crash when removing whitelisted clients which could caused deadlocks
Diffstat (limited to 'applications')
-rwxr-xr-x | applications/luci-splash/root/usr/sbin/luci-splash | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/applications/luci-splash/root/usr/sbin/luci-splash b/applications/luci-splash/root/usr/sbin/luci-splash index a7954211b..d2b860e58 100755 --- a/applications/luci-splash/root/usr/sbin/luci-splash +++ b/applications/luci-splash/root/usr/sbin/luci-splash @@ -411,16 +411,24 @@ function remove_whitelist(mac) end function remove_whitelist_tc(mac) - if debug then - print("Removing whitelist filters for " .. mac) - end uci:foreach("luci_splash", "iface", function(s) local device = get_physdev(s['.name']) if device and device ~= "" then + if debug then + print("Removing whitelist filters for %s interface %s." % {mac, device}) + end local handle = get_filter_handle('ffff:', 'src', device, mac) - exec('tc filter del dev "%s" parent ffff: protocol ip prio 1 handle %s u32' % { device, handle }) + if handle then + exec('tc filter del dev "%s" parent ffff: protocol ip prio 1 handle %s u32' % { device, handle }) + else + print('Warning! Could not get a handle for %s parent :ffff on interface %s' % { mac, device }) + end local handle = get_filter_handle('1:', 'dest', device, mac) - exec('tc filter del dev "%s" parent 1:0 protocol ip prio 1 handle %s u32' % { device, handle }) + if handle then + exec('tc filter del dev "%s" parent 1:0 protocol ip prio 1 handle %s u32' % { device, handle }) + else + print('Warning! Could not get a handle for %s parent 1:0 on interface %s' % { mac, device }) + end end end) end @@ -493,6 +501,8 @@ function remove_lease_rule(mac, ipaddr, device, limit_up, limit_down) local handle = get_filter_handle('ffff:', 'src', device, mac) if handle then exec('tc filter del dev "%s" parent ffff: protocol ip prio 2 handle %s u32 police rate %skbit mtu 6k burst 6k drop' % {device, handle, limit_up}) + else + print('Warning! Could not get a handle for %s parent :ffff on interface %s' % { mac, device }) end end |