diff options
author | Manuel Munz <freifunk@somakoma.de> | 2013-08-18 20:37:35 +0000 |
---|---|---|
committer | Manuel Munz <freifunk@somakoma.de> | 2013-08-18 20:37:35 +0000 |
commit | 15088f5dd4f53cb25e71a871dd4ed25440ec7eb5 (patch) | |
tree | 87e29264d4e21b200a44db35b0646d3c5f842a75 /applications/luci-splash/root | |
parent | 54da15fc7f96af3a8674eef81403dc014a5f39a7 (diff) |
applications/luci-splash: Always allow clients to connect to the community homepage, make description of allowed hosts/subnets more clear, #595
Diffstat (limited to 'applications/luci-splash/root')
-rwxr-xr-x | applications/luci-splash/root/etc/init.d/luci_splash | 8 | ||||
-rwxr-xr-x | applications/luci-splash/root/usr/sbin/luci-splash | 8 |
2 files changed, 12 insertions, 4 deletions
diff --git a/applications/luci-splash/root/etc/init.d/luci_splash b/applications/luci-splash/root/etc/init.d/luci_splash index 3607732188..4f36252e6a 100755 --- a/applications/luci-splash/root/etc/init.d/luci_splash +++ b/applications/luci-splash/root/etc/init.d/luci_splash @@ -270,6 +270,14 @@ start() { config_foreach iface_add iface config_foreach subnet_add subnet + ### Add the community homepage to the list of allowed destination subnets + hp=$(uci -q get freifunk.community.homepage) && { + chp=${hp#http*://} + chp=${chp%%/*} + $IPT -t nat -I luci_splash_prerouting -d "${chp}/32" -j RETURN + $IPT -t filter -I luci_splash_forwarding -d "${chp}/32" -j RETURN + } + ### Find active mac addresses MACS="" diff --git a/applications/luci-splash/root/usr/sbin/luci-splash b/applications/luci-splash/root/usr/sbin/luci-splash index e1f8d4162e..a34eecae9a 100755 --- a/applications/luci-splash/root/usr/sbin/luci-splash +++ b/applications/luci-splash/root/usr/sbin/luci-splash @@ -66,14 +66,14 @@ end -function get_filter_handle(parent, direction, device) +function get_filter_handle(parent, direction, device, mac) local input = utl.split(sys.exec('/usr/sbin/tc filter show dev ' .. device .. ' parent ' .. parent) or {}) local tbl = {} local handle for k, v in pairs(input) do handle = v:match('filter protocol ip pref %d+ u32 fh (%d*:%d*:%d*) order') if handle then - local mac1, mac2, mac3, mac4, mac5, mac6 + local mac, mac1, mac2, mac3, mac4, mac5, mac6 if direction == 'src' then mac1, mac2, mac3, mac4 = input[k+1]:match('match ([%a%d][%a%d])([%a%d][%a%d])([%a%d][%a%d])([%a%d][%a%d])/ffffffff') mac5, mac6 = input[k+2]:match('match ([%a%d][%a%d])([%a%d][%a%d])0000/ffff0000') @@ -87,8 +87,8 @@ function get_filter_handle(parent, direction, device) end end end - if tbl[mac:lower()] then - handle = tbl[mac:lower()] + if tbl[mac] then + handle = tbl[mac] end return handle end |