1 |
--- smeserver-coova-chilli-0.2/root/etc/e-smith/templates/etc/rc.d/init.d/masq/00Functions01Chilli40forwardFrom.fixe_allow_uamallowed 2009-06-11 02:39:29.000000000 +0200 |
2 |
+++ smeserver-coova-chilli-0.2/root/etc/e-smith/templates/etc/rc.d/init.d/masq/00Functions01Chilli40forwardFrom 2009-06-11 02:40:59.000000000 +0200 |
3 |
@@ -36,13 +36,14 @@ |
4 |
} |
5 |
|
6 |
foreach (split(/[;,]/, ${'chilli'}{'uamallowed'} || '')){ |
7 |
- # Check the rules has the form proto:remote_host:remote_port |
8 |
- # Or host:port or protocol:host |
9 |
- next unless /^((tcp|TCP|udp|UDP):)?((${ReIpAddr})|((\w+\.)?\w+\.\w{2,3}))(:${RePort})?$/; |
10 |
- my $proto = $1; |
11 |
- my $host = $2; |
12 |
- my $dport = $3; |
13 |
- $OUT .= " # $_ is allowed:\n"; |
14 |
+ # Check the rules has the form proto:remote_host:remote_port |
15 |
+ # Or host:port or protocol:host |
16 |
+ next unless /^((tcp|TCP|udp|UDP):)?(${ReIpAddr})(:${RePort})?$/; |
17 |
+ my @param = split(/:/, $_); |
18 |
+ my $proto = $param[0]; |
19 |
+ my $host = $param[1]; |
20 |
+ my $dport = $param[2]; |
21 |
+ $OUT .= " # $_ is allowed:\n"; |
22 |
$OUT .= " /sbin/iptables -A FORWARD_FROM_CHILLI "; |
23 |
$OUT .= "-p $proto " if (($proto) && ($proto ne '')); |
24 |
$OUT .= "-d $host "; |
25 |
@@ -51,6 +52,7 @@ |
26 |
$OUT .= "-j ACCEPT\n" |
27 |
} |
28 |
|
29 |
+ |
30 |
# Allow the two dns servers specified |
31 |
$OUT .= " # Allow dns requests to ${'chilli'}{'dns1'}\n" . |
32 |
" /sbin/iptables -A FORWARD_FROM_CHILLI -p udp --dport 53 -d ${'chilli'}{'dns1'} -j ACCEPT\n" |