X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=blobdiff_plain;f=html%2Fcgi-bin%2Flogs.cgi%2Fshowrequestfromcountry.dat;h=5283c426b88de0e9059231fa829c4030b646cb35;hp=c8421161882df63f30752273790e25592a133d73;hb=fde47f5aef2aa779350cec85b5c19327fa36b938;hpb=c438fb070e42080e86da5de68f0a6700960ef2d2 diff --git a/html/cgi-bin/logs.cgi/showrequestfromcountry.dat b/html/cgi-bin/logs.cgi/showrequestfromcountry.dat index c842116188..5283c426b8 100644 --- a/html/cgi-bin/logs.cgi/showrequestfromcountry.dat +++ b/html/cgi-bin/logs.cgi/showrequestfromcountry.dat @@ -159,8 +159,15 @@ if (!$skip) while () { if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) { - if($_ =~ /SRC\=([\d\.]+)/){ - my $srcaddr=$1; + my $packet = $2; + $packet =~ /IN=(\w+)/; my $iface=$1; if ( $1 =~ /2./ ){ $iface="";} + $packet =~ /SRC=([\d\.]+)/; my $srcaddr=$1; + + if($iface eq $country) { + $log[$lines] = $_; + $lines++; + } + elsif($srcaddr ne '') { my $ccode = $gi->country_code_by_name($srcaddr); if($ccode eq $country){ $log[$lines] = $_; @@ -301,10 +308,17 @@ $lines = 0; foreach $_ (@slice) { $a = $_; - if($_ =~ /SRC\=([\d\.]+)/){ - my $srcaddr=$1; - my $ccode = $gi->country_code_by_name($srcaddr); - if($ccode eq $country){ + /^... (..) (..:..:..) [\w\-]+ kernel:(.*)(IN=.*)$/; + my $packet = $4; + $packet =~ /IN=(\w+)/; my $iface=$1; if ( $1 =~ /2./ ){ $iface="";} + $packet =~ /SRC=([\d\.]+)/; my $srcaddr=$1; + + if($iface eq $country || $srcaddr ne '') { + my $ccode; + if($iface ne $country) { + $ccode = $gi->country_code_by_name($srcaddr); + } + if($iface eq $country || $ccode eq $country) { my $chain = ''; my $in = '-'; my $out = '-'; my $srcaddr = ''; my $dstaddr = '';