summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-splash
diff options
context:
space:
mode:
authorManuel Munz <freifunk@somakoma.de>2013-06-04 19:24:30 +0000
committerManuel Munz <freifunk@somakoma.de>2013-06-04 19:24:30 +0000
commit2a366f4c554d46a33f727bc04e4d7a7798e5be3b (patch)
treea621bd26b6efc0dc17360d9296a5ae0a953b095f /applications/luci-splash
parent49fc87429ff313ef37a9473147ddd8cf97d74d08 (diff)
applications/luci-splash: Always insert the mangling rules, not just when bandwidth limit is used. That makes it possible to have client bandwidth stats without using the bandwidth limit. Taken from https://github.com/freifunk/ff-control/blob/master/patches/luci-splash-mark.patch, thx Patrick
Diffstat (limited to 'applications/luci-splash')
-rwxr-xr-xapplications/luci-splash/root/etc/init.d/luci_splash22
-rwxr-xr-xapplications/luci-splash/root/usr/sbin/luci-splash8
2 files changed, 15 insertions, 15 deletions
diff --git a/applications/luci-splash/root/etc/init.d/luci_splash b/applications/luci-splash/root/etc/init.d/luci_splash
index fe8062882..d2628c86f 100755
--- a/applications/luci-splash/root/etc/init.d/luci_splash
+++ b/applications/luci-splash/root/etc/init.d/luci_splash
@@ -245,18 +245,16 @@ start() {
fi
### Add QoS chain
- [ "$LIMIT_UP" -gt 0 -a "$LIMIT_DOWN" -gt 0 ] && {
- iptables -t mangle -N luci_splash_mark_out
- iptables -t mangle -N luci_splash_mark_in
- iptables -t mangle -I PREROUTING -j luci_splash_mark_out
- iptables -t mangle -I POSTROUTING -j luci_splash_mark_in
- if [ "$HAS_IPV6" = 1 ]; then
- ip6tables -t mangle -N luci_splash_mark_out
- ip6tables -t mangle -N luci_splash_mark_in
- ip6tables -t mangle -I PREROUTING -j luci_splash_mark_out
- ip6tables -t mangle -I POSTROUTING -j luci_splash_mark_in
- fi
- }
+ iptables -t mangle -N luci_splash_mark_out
+ iptables -t mangle -N luci_splash_mark_in
+ iptables -t mangle -I PREROUTING -j luci_splash_mark_out
+ iptables -t mangle -I POSTROUTING -j luci_splash_mark_in
+ if [ "$HAS_IPV6" = 1 ]; then
+ ip6tables -t mangle -N luci_splash_mark_out
+ ip6tables -t mangle -N luci_splash_mark_in
+ ip6tables -t mangle -I PREROUTING -j luci_splash_mark_out
+ ip6tables -t mangle -I POSTROUTING -j luci_splash_mark_in
+ fi
### 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 bf32d635e..34b2e9c42 100755
--- a/applications/luci-splash/root/usr/sbin/luci-splash
+++ b/applications/luci-splash/root/usr/sbin/luci-splash
@@ -304,9 +304,11 @@ end
-- Add an iptables rule
function add_lease_rule(mac, ipaddr)
- if limit_up > 0 and limit_down > 0 then
- os.execute("iptables -t mangle -I luci_splash_mark_out -m mac --mac-source %q -j MARK --set-mark 79" % mac)
- os.execute("iptables -t mangle -I luci_splash_mark_in -d %q -j MARK --set-mark 80" % ipaddr)
+ os.execute("iptables -t mangle -I luci_splash_mark_out -m mac --mac-source %q -j MARK --set-mark 79" % mac)
+ os.execute("iptables -t mangle -I luci_splash_mark_in -d %q -j MARK --set-mark 80" % ipaddr)
+ if has_ipv6 then
+ os.execute("ip6tables -t mangle -I luci_splash_mark_out -m mac --mac-source %q -j MARK --set-mark 79" % mac)
+ os.execute("ip6tables -t mangle -I luci_splash_mark_in -d %q -j MARK --set-mark 80" % ipaddr)
end