applications/luci-splash: Always insert the mangling rules, not just when bandwidth...
authorManuel Munz <freifunk@somakoma.de>
Tue, 4 Jun 2013 19:24:30 +0000 (19:24 +0000)
committerManuel Munz <freifunk@somakoma.de>
Tue, 4 Jun 2013 19:24:30 +0000 (19:24 +0000)
applications/luci-splash/root/etc/init.d/luci_splash
applications/luci-splash/root/usr/sbin/luci-splash

index fe80628..d2628c8 100755 (executable)
@@ -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=""
index bf32d63..34b2e9c 100755 (executable)
@@ -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