[x-wrt] r4809 committed - A different fix to #144. Allow user to set the dest and/or src to Rout...

1 view
Skip to first unread message

codesite...@google.com

unread,
Aug 19, 2009, 1:51:29 AM8/19/09
to x-wrt-...@googlegroups.com
Revision: 4809
Author: kemen04
Date: Tue Aug 18 22:50:30 2009
Log: A different fix to #144. Allow user to set the dest and/or src to
Router.
http://code.google.com/p/x-wrt/source/detail?r=4809

Modified:
/trunk/package/webif/files/www/cgi-bin/webif/network-firewall.sh

=======================================
--- /trunk/package/webif/files/www/cgi-bin/webif/network-firewall.sh Thu
Aug 13 17:50:17 2009
+++ /trunk/package/webif/files/www/cgi-bin/webif/network-firewall.sh Tue
Aug 18 22:50:30 2009
@@ -24,8 +24,6 @@
fi
[ -z "$FORM_port_select_rule" ] && FORM_port_select_rule=custom
[ -z "$FORM_target_rule" ] && FORM_target_rule=ACCEPT
-[ -z "$FORM_src_rule" ] && FORM_src_rule=wan
-[ -z "$FORM_dest_rule" ] && FORM_dest_rule=lan
#Add new rules
if [ -n "$FORM_port_rule" -o "$FORM_port_select_rule" != "custom" ]; then
validate <<EOF
@@ -173,8 +171,8 @@
append forms "$form" "$N"
for rule in $rule_cfgs; do
if [ "$FORM_submit" = "" -o "$add_rule_cfg" = "$rule" ]; then
- config_get FORM_src "$rule" src
- config_get FORM_dest "$rule" dest "$FORM_src"
+ config_get FORM_src "$rule" src "wan"
+ config_get FORM_dest "$rule" dest
config_get FORM_protocol "$rule" proto
config_get FORM_src_ip "$rule" src_ip
config_get FORM_dest_ip "$rule" dest_ip
@@ -196,11 +194,7 @@
EOF
equal "$?" 0 && {
uci_set firewall "$rule" src "$FORM_src"
- if [ "$FORM_src" = "$FORM_dest" ]; then
- uci_set firewall "$rule" dest ""
- else
- uci_set firewall "$rule" dest "$FORM_dest"
- fi
+ uci_set firewall "$rule" dest "$FORM_dest"
uci_set firewall "$rule" proto "$FORM_protocol"
uci_set firewall "$rule" src_ip "$FORM_src_ip"
uci_set firewall "$rule" dest_ip "$FORM_dest_ip"
@@ -215,10 +209,12 @@
string|<td>$name</td>
string|<td>
select|src_$rule|$FORM_src
+ option||@TR<<Router>>
$networks
string|</td>
string|<td>
select|dest_$rule|$FORM_dest
+ option||@TR<<Router>>
$networks
string|</td>
string|<td>
@@ -255,11 +251,13 @@
text|name|$FORM_name
string|</td>
string|<td>
- select|src_rule|$FORM_src_rule
+ select|src_rule|wan
+ option||@TR<<Router>>
$networks
string|</td>
string|<td>
- select|dest_rule|$FORM_dest_rule
+ select|dest_rule|
+ option||@TR<<Router>>
$networks
string|</td>
string|<td>

Reply all
Reply to author
Forward
0 new messages