From 9e050072237e97b81f04cee67c4f36c41ef13ae9 Mon Sep 17 00:00:00 2001 From: smos Date: Mon, 21 Feb 2011 15:46:23 +0100 Subject: Prevent empty remote endpoints from skewing the log output --- usr/local/www/diag_logs_ipsec.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'usr/local/www') diff --git a/usr/local/www/diag_logs_ipsec.php b/usr/local/www/diag_logs_ipsec.php index b0bba94..560cd1a 100755 --- a/usr/local/www/diag_logs_ipsec.php +++ b/usr/local/www/diag_logs_ipsec.php @@ -54,6 +54,8 @@ $replace = array(); if(is_array($config['ipsec']['phase1'])) foreach($config['ipsec']['phase1'] as $ph1ent) { $gateway = ipsec_get_phase1_dst($ph1ent); + if(!is_ipaddr($gateway)) + continue; $search[] = "/(racoon: )([A-Z:].*?)({$gateway}\[[0-9].+\]|{$gateway})(.*)/i"; $replace[] = "$1[{$ph1ent['descr']}]: $2$3$4"; } -- cgit v1.1