From: Andrew Ruthven Date: Fri, 18 Mar 2011 09:34:54 +0000 (+1300) Subject: The $re changes everytime through the loops, so we can't optimise it. X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;p=spong.git The $re changes everytime through the loops, so we can't optimise it. This bug meant that only the first regex in the INC and EXCL lists was ever used. --- diff --git a/contrib/plugins/spong-server/data_sendmsg b/contrib/plugins/spong-server/data_sendmsg index 9f74ffb..1d57aae 100644 --- a/contrib/plugins/spong-server/data_sendmsg +++ b/contrib/plugins/spong-server/data_sendmsg @@ -38,13 +38,13 @@ sub data_sendmsg { # Check the list of hosts to exclude foreach my $re (@SENDMSG_EXCL_HOSTS) { - if ( $host =~ /$re/o ) { return; } # If we get a hit, return + if ( $host =~ /$re/ ) { return; } # If we get a hit, return } # Check the lists of hosts to include my $hit=0; foreach my $re (@SENDMSG_INC_HOSTS) { - if ( $host =~ /$re/o ) { $hit=1; last; } # If we get a hit, set flag + if ( $host =~ /$re/ ) { $hit=1; last; } # If we get a hit, set flag } return unless $hit; # Return unless we got a hit