diff options
author | Ermal Luçi <eri@pfsense.org> | 2009-12-27 19:35:24 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2009-12-27 19:35:24 +0000 |
commit | 0276fe8b2fb8497ec4f2201869d4af885c116be5 (patch) | |
tree | 6e89f45e035f08f3ddb48a3d9e0feecaf59d39eb /etc/inc/filter.inc | |
parent | a7503d91247e5820a1480e123b54de0fa8055c9c (diff) | |
download | pfsense-0276fe8b2fb8497ec4f2201869d4af885c116be5.zip pfsense-0276fe8b2fb8497ec4f2201869d4af885c116be5.tar.gz |
Fix some other problems with reflection code. Feedback #99.
Diffstat (limited to 'etc/inc/filter.inc')
-rw-r--r-- | etc/inc/filter.inc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 89292f5..86399d6 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -772,6 +772,7 @@ function filter_generate_reflection($rule, $target, $extport, &$starting_localho $rflctnorange = false; } + $inetdport = $starting_localhost_port; if(($range_end - 1) > $extport[0]) { $rflctrange = "{$starting_localhost_port}"; $delta = $range_end - $extport[0] - 1; @@ -794,7 +795,6 @@ function filter_generate_reflection($rule, $target, $extport, &$starting_localho switch($rule['protocol']) { case "tcp/udp": $protocol = "{ tcp udp }"; - $inetdport = $extport[0]; foreach($toadd_array as $tda) { $reflection_txt[] = "{$inetdport}\tstream\ttcp\tnowait/0\tnobody\t/usr/bin/nc -w {$reflectiontimeout} {$target} {$tda}\n"; $reflection_txt[] = "{$inetdport}\tdgram\tudp\tnowait/0\tnobody\t/usr/bin/nc -u -w {$reflectiontimeout} {$target} {$tda}\n"; @@ -812,9 +812,8 @@ function filter_generate_reflection($rule, $target, $extport, &$starting_localho $socktype = "stream"; $dash_u = ""; } - $inetdport = $extport[0]; foreach($toadd_array as $tda){ - $reflection_txt[] = "{$inetdport}\t{$socktype}\t{$protocol}\tnowait/0\tnobody\t/usr/bin/nc nc {$dash_u}-w {$reflectiontimeout} {$target} {$tda}\n"; + $reflection_txt[] = "{$inetdport}\t{$socktype}\t{$protocol}\tnowait/0\tnobody\t/usr/bin/nc {$dash_u}-w {$reflectiontimeout} {$target} {$tda}\n"; $inetdport++; } $natrules .= "rdr on { {$ifname['if']} } proto {$protocol} from any to {$extaddr} port {$rflctintrange} tag PFREFLECT -> 127.0.0.1 port {$rflctrange}\n"; |