[package] firewall: add option to disable NAT reflection
[openwrt.git] / package / firewall / files / reflection.hotplug
index af88fe0..6b1cd60 100644 (file)
@@ -2,7 +2,7 @@
 
 . /etc/functions.sh
 
-if [ "$ACTION" = "ifup" ] && [ "$INTERFACE" = "wan" ]; then
+if [ "$ACTION" = "add" ] && [ "$INTERFACE" = "wan" ]; then
        local wanip=$(uci -P/var/state get network.wan.ipaddr)
 
        iptables -t nat -F nat_reflection_in 2>/dev/null || {
@@ -53,6 +53,10 @@ if [ "$ACTION" = "ifup" ] && [ "$INTERFACE" = "wan" ]; then
                                local proto
                                config_get proto "$cfg" proto
 
+                               local reflection
+                               config_get_bool reflection "$cfg" reflection 1
+                               [ "$reflection" == 1 ] || return
+
                                local epmin epmax extport
                                config_get extport "$cfg" src_dport
                                [ -n "$extport" ] || return
This page took 0.02117 seconds and 4 git commands to generate.