fix missing update for include() api change (#815)
[openwrt-10.03/.git] / package / iptables / files / firewall.init
index a0bd99ef9a9de84a21debebc5268b2661fab6a12..4acd325a994bf6f816cfe3424a8664e6eb2be8bc 100755 (executable)
@@ -4,7 +4,7 @@
 ## Please make changes in /etc/firewall.user
 
 . /etc/functions.sh
-include network
+include /lib/network
 
 scan_interfaces
 config_get WAN wan ifname
@@ -23,6 +23,10 @@ iptables -N forwarding_rule
 iptables -t nat -N prerouting_rule
 iptables -t nat -N postrouting_rule
 
+iptables -N LAN_ACCEPT
+[ -z "$WAN" ] || iptables -A LAN_ACCEPT -i "$WAN" -j RETURN
+iptables -A LAN_ACCEPT -j ACCEPT
+
 ### INPUT
 ###  (connections with the router as destination)
 
@@ -38,7 +42,7 @@ iptables -t nat -N postrouting_rule
   iptables -A INPUT -j input_rule
 
   # allow
-  iptables -A INPUT ${WAN:+-i \! $WAN} -j ACCEPT       # allow from lan/wifi interfaces 
+  iptables -A INPUT -j LAN_ACCEPT      # allow from lan/wifi interfaces 
   iptables -A INPUT -p icmp    -j ACCEPT       # allow ICMP
   iptables -A INPUT -p gre     -j ACCEPT       # allow GRE