mirror of
https://github.com/hak5/wifipineapple-openwrt.git
synced 2025-10-29 16:57:19 +00:00
adds more sanity checks to uci firewall
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@12392 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
1d44d1a5ba
commit
9f8fc52bbc
@ -181,6 +181,8 @@ fw_rule() {
|
||||
[ -n "$dest" ] && TARGET=zone_${dest}_$target || TARGET=$target
|
||||
[ -n "$dest_port" -a -z "$proto" ] && { \
|
||||
echo "dport may only be used it proto is defined"; return; }
|
||||
[ -n "$src_port" -a -z "$proto" ] && { \
|
||||
echo "sport may only be used it proto is defined"; return; }
|
||||
$IPTABLES -I $ZONE 1 \
|
||||
${proto:+-p $proto} \
|
||||
${src_ip:+-s $src_ip} \
|
||||
@ -225,6 +227,8 @@ fw_redirect() {
|
||||
echo "redirect needs src and dest_ip"; return ; }
|
||||
[ -n "$dest_port" -a -z "$proto" ] && { \
|
||||
echo "dport may only be used it proto is defined"; return; }
|
||||
[ -n "$src_port" -a -z "$proto" ] && { \
|
||||
echo "sport may only be used it proto is defined"; return; }
|
||||
$IPTABLES -A zone_${src}_prerouting -t nat \
|
||||
${proto:+-p $proto} \
|
||||
${src_ip:+-s $src_ip} \
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user