From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Eitelwein To: development@lists.ipfire.org Subject: PATCH 3/5] Firewall chain was not extracted correctly when ipv6 uses bridge Date: Sun, 10 Jan 2016 18:37:22 +0100 Message-ID: <569296D2.8090904@eitelwein.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1471928539722321935==" List-Id: --===============1471928539722321935== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Fixing a bug in previous patch. Signed-off-by: Michael Eitelwein --- html/cgi-bin/logs.cgi/firewalllog.dat | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/html/cgi-bin/logs.cgi/firewalllog.dat b/html/cgi-bin/logs.cgi/fi= rewalllog.dat index 42c9612..7ae9be6 100644 --- a/html/cgi-bin/logs.cgi/firewalllog.dat +++ b/html/cgi-bin/logs.cgi/firewalllog.dat @@ -330,21 +330,21 @@ foreach $_ (@log) { # If ipv6 uses a bridge, PHYSIN=3D contains the relevant iface informat= ion # otherwise use IN=3D - if ($_ =3D~ /^... (..) (..:..:..) [\w\-]+ kernel:(.*)(PHYSIN=3D.*)$/= ) {} - elsif ($_ =3D~ /^... (..) (..:..:..) [\w\-]+ kernel:(.*)(IN=3D.*)$/)= {} + my $packet =3D ''; + if ($_ =3D~ /^... (..) (..:..:..) [\w\-]+ kernel:(.*)(IN=3D.*)(PHYSI= N=3D.*)$/) { $packet =3D $5; } + elsif ($_ =3D~ /^... (..) (..:..:..) [\w\-]+ kernel:(.*)(IN=3D.*)$/)= { $packet =3D $4; } my $day =3D $1; $day =3D~ tr / /0/; my $time =3D $cgiparams{'DAY'} ? "$2" : "$day/$2" ; - my $comment =3D $3; - my $packet =3D $4; + my $chain =3D $3; my ($iface, $srcaddr, $dstaddr, $macaddr, $proto, $srcport, $dstpor= t); - if ($packet =3D~ /PHYSIN=3D(\w+)/) { $iface=3D$1 } elsif ($packet = =3D~ /IN=3D(\w+)/) { $iface =3D $1} + if ($packet =3D~ /PHYSIN=3D(\w+)/) { $iface=3D$1 } elsif ($packet = =3D~ /IN=3D(\w+)/) { $iface =3D $1; } # Identify whether ipv4 or ipv6. Both are mutally exclusive. - if ($packet =3D~ /SRC\=3D(([\d]{1,3})(\.([\d]{1,3})){3})/) { $srcadd= r=3D$1 } - if ($packet =3D~ /SRC\=3D(([0-9a-fA-F]{0,4})(\:([0-9a-fA-F]{= 0,4})){2,7})/) { $srcaddr=3D$1 } - if ($packet =3D~ /DST\=3D(([\d]{1,3})(\.([\d]{1,3})){3})/) { $dstadd= r=3D$1 } - if ($packet =3D~ /DST\=3D(([0-9a-fA-F]{0,4})(\:([0-9a-fA-F]{= 0,4})){2,7})/) { $dstaddr=3D$1 } + if ($packet =3D~ /SRC\=3D(([\d]{1,3})(\.([\d]{1,3})){3})/) { $srcadd= r=3D$1; } + if ($packet =3D~ /SRC\=3D(([0-9a-fA-F]{0,4})(\:([0-9a-fA-F]{= 0,4})){2,7})/) { $srcaddr=3D$1; } + if ($packet =3D~ /DST\=3D(([\d]{1,3})(\.([\d]{1,3})){3})/) { $dstadd= r=3D$1; } + if ($packet =3D~ /DST\=3D(([0-9a-fA-F]{0,4})(\:([0-9a-fA-F]{= 0,4})){2,7})/) { $dstaddr=3D$1; } $macaddr=3D$1 if $packet =3D~ /MAC=3D([\w+\:]+)/; $proto=3D$1 if $packet =3D~ /PROTO=3D(\w+)/; $srcport=3D$1 if $packet =3D~ /SPT=3D(\d+)/; @@ -372,7 +372,7 @@ foreach $_ (@log) print <$time - $comment + $chain $iface $proto $srcaddr
$dstaddr= --=20 1.9.1 --===============1471928539722321935==--