diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2010-09-16 11:47:35 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2010-09-16 11:47:35 +0000 |
commit | f90328f26ef73fc5a0c2d9a751936e9af060ccba (patch) | |
tree | 8b43a2a7814861c1265ad9747419d8ad19be6c9f /package/firewall/files/lib/core_redirect.sh | |
parent | 4df10391ba87d347aebbcd20e1ab475690f07f80 (diff) | |
download | mtk-20170518-f90328f26ef73fc5a0c2d9a751936e9af060ccba.zip mtk-20170518-f90328f26ef73fc5a0c2d9a751936e9af060ccba.tar.gz mtk-20170518-f90328f26ef73fc5a0c2d9a751936e9af060ccba.tar.bz2 |
firewall: make invalid redirects and duplicate zones non-fatal, print a notice and discard them
SVN-Revision: 23080
Diffstat (limited to 'package/firewall/files/lib/core_redirect.sh')
-rw-r--r-- | package/firewall/files/lib/core_redirect.sh | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/package/firewall/files/lib/core_redirect.sh b/package/firewall/files/lib/core_redirect.sh index 72364a9..3a37bb7 100644 --- a/package/firewall/files/lib/core_redirect.sh +++ b/package/firewall/files/lib/core_redirect.sh @@ -30,7 +30,8 @@ fw_load_redirect() { local fwdchain natchain natopt nataddr natports srcdaddr srcdports if [ "$redirect_target" == "DNAT" ]; then [ -n "$redirect_src" -a -n "$redirect_dest_ip$redirect_dest_port" ] || { - fw_die "DNAT redirect ${redirect_name}: needs src and dest_ip or dest_port" + fw_log error "DNAT redirect ${redirect_name}: needs src and dest_ip or dest_port, skipping" + return 0 } fwdchain="zone_${redirect_src}_forward" @@ -48,7 +49,8 @@ fw_load_redirect() { elif [ "$redirect_target" == "SNAT" ]; then [ -n "$redirect_dest" -a -n "$redirect_src_dip" ] || { - fw_die "SNAT redirect ${redirect_name}: needs dest and src_dip" + fw_log error "SNAT redirect ${redirect_name}: needs dest and src_dip, skipping" + return 0 } fwdchain="${redirect_src:+zone_${redirect_src}_forward}" @@ -65,7 +67,8 @@ fw_load_redirect() { append FW_CONNTRACK_ZONES $redirect_dest else - fw_die "redirect ${redirect_name}: target must be either DNAT or SNAT" + fw_log error "redirect ${redirect_name}: target must be either DNAT or SNAT, skipping" + return 0 fi local mode |