From 2f90ab8ca65fff3ab5f64ae8da8eb3cd92eb0a4c Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 16 Aug 2009 13:36:09 -0400 Subject: When a UDP reflection line was added for inetd, it was added as stream --- etc/inc/filter.inc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'etc/inc') diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 33e7f90..3953825 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -1203,15 +1203,18 @@ function filter_nat_rules_generate() { $toadd_array[] = $loc_pt_translated; } foreach($toadd_array as $tda){ - if($protocol == "udp") + if($protocol == "udp") { + $socktype = "dgram"; $dash_u = "-u "; - else + } else { + $socktype = "stream"; $dash_u = ""; + } if($config['system']['reflectiontimeout']) $reflectiontimeout = $config['system']['reflectiontimeout']; else $reflectiontimeout = "2000"; - fwrite($inetd_fd, "{$starting_localhost_port}\tstream\t{$protocol}\tnowait/0\tnobody\t/usr/bin/nc nc {$dash_u}-w {$reflectiontimeout} {$target} {$tda}\n"); + fwrite($inetd_fd, "{$starting_localhost_port}\t{$socktype}\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++; -- cgit v1.1