From 12b3e2072a87d209c766be18e493780660690d0f Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 7 May 2007 23:47:16 +0000 Subject: Tighten the home net checks trying to eliminte blank entries that can lead to ,/, --- packages/snort/snort.inc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'packages/snort') diff --git a/packages/snort/snort.inc b/packages/snort/snort.inc index b6ff4d29..14c9a33a 100644 --- a/packages/snort/snort.inc +++ b/packages/snort/snort.inc @@ -236,24 +236,28 @@ function generate_snort_conf() { $home_net .= "{$subnet} "; } else { if ($subnet) - $home_net .= "{$subnet}/{$ifcfg['subnet']} "; + if($ifcfg['subnet']) + $home_net .= "{$subnet}/{$ifcfg['subnet']} "; } } /* add all WAN ips to the whitelist */ $wan_if = get_real_wan_interface(); $ip = find_interface_ip($wan_if); - $home_net .= "{$ip} "; + if($ip) + $home_net .= "{$ip} "; /* Add Gateway on WAN interface to whitelist (For RRD graphs) */ $int = convert_friendly_interface_to_real_interface_name("WAN"); $gw = get_interface_gateway($int); - $home_net .= "{$gw} "; + if($gw) + $home_net .= "{$gw} "; /* Add DNS server for WAN interface to whitelist */ $dns_servers = get_dns_servers(); foreach($dns_servers as $dns) { - $home_net .= "{$dns} "; + if($dns) + $home_net .= "{$dns} "; } /* Add loopback to whitelist (ftphelper) */ -- cgit v1.2.3