diff options
author | Manuel Munz <freifunk@somakoma.de> | 2013-10-13 22:40:09 +0000 |
---|---|---|
committer | Manuel Munz <freifunk@somakoma.de> | 2013-10-13 22:40:09 +0000 |
commit | 0c1f8b8aa31f34c0036bd798e5949188baa6d5b2 (patch) | |
tree | 222db55a6d88baaf881fc40770f142a3eed479ea | |
parent | 2aad24cec13cbc4765cbbc5502832184713b823f (diff) |
applications/luci-splash: Fix two problems with whitelisting clients
-rwxr-xr-x | applications/luci-splash/root/etc/init.d/luci_splash | 2 | ||||
-rwxr-xr-x | applications/luci-splash/root/usr/sbin/luci-splash | 16 |
2 files changed, 11 insertions, 7 deletions
diff --git a/applications/luci-splash/root/etc/init.d/luci_splash b/applications/luci-splash/root/etc/init.d/luci_splash index 45c4d382ad..feefabd81a 100755 --- a/applications/luci-splash/root/etc/init.d/luci_splash +++ b/applications/luci-splash/root/etc/init.d/luci_splash @@ -114,7 +114,7 @@ whitelist_add() { config_get mac "$1" mac iface=$2 $TC filter add dev "$iface" parent ffff: protocol ip prio 1 u32 match ether src $mac police pass - $TC filter add dev "$iface" parent 1:0 protocol ip prio 1 u32 match ether dst classid 1:1 + $TC filter add dev "$iface" parent 1:0 protocol ip prio 1 u32 match ether dst $mac classid 1:1 } diff --git a/applications/luci-splash/root/usr/sbin/luci-splash b/applications/luci-splash/root/usr/sbin/luci-splash index 88f2250c5f..de5332330b 100755 --- a/applications/luci-splash/root/usr/sbin/luci-splash +++ b/applications/luci-splash/root/usr/sbin/luci-splash @@ -390,10 +390,12 @@ function remove_whitelist_tc(mac) end uci:foreach("luci_splash", "iface", function(s) local device = get_physdev(s['.name']) - 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 }) - 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 device and device ~= "" then + 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 }) + 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 }) + end end) end @@ -486,8 +488,10 @@ function add_whitelist_rule(mac) end uci:foreach("luci_splash", "iface", function(s) local device = get_physdev(s['.name']) - exec('tc filter add dev "%s" parent ffff: protocol ip prio 1 u32 match ether src %s police pass' % { device, mac }) - exec('tc filter add dev "%s" parent 1:0 protocol ip prio 1 u32 match ether dst %s classid 1:1' % { device, mac }) + if device and device ~= "" then + exec('tc filter add dev "%s" parent ffff: protocol ip prio 1 u32 match ether src %s police pass' % { device, mac }) + exec('tc filter add dev "%s" parent 1:0 protocol ip prio 1 u32 match ether dst %s classid 1:1' % { device, mac }) + end end) end |