summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-03-28 00:15:46 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-03-28 00:15:46 +0000
commita2e114ec99cc3476c79759a0862982adc7d87c19 (patch)
tree42e2fbb2c49ee336b1045f068dadcef97d2234d3 /etc
parent7738faa8cc135881b5648474fee91f0ab7680550 (diff)
downloadpfsense-a2e114ec99cc3476c79759a0862982adc7d87c19.zip
pfsense-a2e114ec99cc3476c79759a0862982adc7d87c19.tar.gz
Make the nat reflection timeout overridable if <system><reflectiontimeout> is specified in config.xml
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/filter.inc14
1 files changed, 11 insertions, 3 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 6d90f49..0857ee8 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -1088,12 +1088,16 @@ function filter_nat_rules_generate() {
$loc_pt_translated = $loc_pt;
$toadd_array[] = $loc_pt_translated;
}
+ if($config['system']['reflectiontimeout'])
+ $reflectiontimeout = $config['system']['reflectiontimeout'];
+ else
+ $reflectiontimeout = "20";
foreach($toadd_array as $tda){
- fwrite($inetd_fd, "{$starting_localhost_port}\tstream\ttcp/udp\tnowait/0\tnobody\t/usr/bin/nc nc -u -w 20 {$target} {$tda}\n");
+ fwrite($inetd_fd, "{$starting_localhost_port}\tstream\ttcp/udp\tnowait/0\tnobody\t/usr/bin/nc nc -u -w {$reflectiontimeout} {$target} {$tda}\n");
if($ifname_real)
$natrules .= "rdr on \${$ifname_real} proto tcp from any to {$extaddr} port { {$xxx} } -> 127.0.0.1 port {$starting_localhost_port}\n";
$starting_localhost_port++;
- fwrite($inetd_fd, "{$starting_localhost_port}\tstream\ttcp/udp\tnowait/0\tnobody\t/usr/bin/nc nc -w 20 {$target} {$tda}\n");
+ fwrite($inetd_fd, "{$starting_localhost_port}\tstream\ttcp/udp\tnowait/0\tnobody\t/usr/bin/nc nc -w {$reflectiontimeout} {$target} {$tda}\n");
if($ifname_real)
$natrules .= "rdr on \${$ifname_real} proto udp from any to {$extaddr} port { {$xxx} } -> 127.0.0.1 port {$starting_localhost_port}\n";
$xxx++;
@@ -1123,7 +1127,11 @@ function filter_nat_rules_generate() {
$dash_u = "-u ";
else
$dash_u = "";
- fwrite($inetd_fd, "{$starting_localhost_port}\tstream\t{$protocol}\tnowait/0\tnobody\t/usr/bin/nc nc {$dash_u}-w 20 {$target} {$tda}\n");
+ if($config['system']['reflectiontimeout'])
+ $reflectiontimeout = $config['system']['reflectiontimeout'];
+ else
+ $reflectiontimeout = "20";
+ fwrite($inetd_fd, "{$starting_localhost_port}\tstream\t{$protocol}\tnowait/0\tnobody\t/usr/bin/nc nc {$dash_u}-w {$reflectiontimeout} {$target} {$tda}\n");
if($ifname_real)
$natrules .= "rdr on \${$ifname_real} proto {$protocol} from any to {$extaddr} port { {$xxx} } -> 127.0.0.1 port {$starting_localhost_port}\n";
$xxx++;
OpenPOWER on IntegriCloud