Skip to content

Commit

Permalink
Make sure nfdump skips NFGEODB for stat lookups
Browse files Browse the repository at this point in the history
  • Loading branch information
phaag committed May 6, 2023
1 parent bb7085d commit f4a066e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions libexec/Lookup.pm
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,25 @@ sub Lookup {

my ($ip, $port);
# IPv4/port
if ( $lookup =~ /^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}):(\d{1,5})$/ ) {
if ( $lookup =~ /^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}):(\d{1,5})/ ) {
$ip = $1;
$port = $2;
# IPv4 ICMP
} elsif ( $lookup =~ /^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}):(\d+\.\d+)$/ ) {
} elsif ( $lookup =~ /^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}):(\d+\.\d+)/ ) {
$ip = $1;
$port = $2;
# IPv4
} elsif ( $lookup =~ /^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$/ ) {
} elsif ( $lookup =~ /^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/ ) {
$ip = $1;
$port = 0;
# IPv6/port
} elsif ( $lookup =~ /^([0-9a-f]+[0-9a-f:]+)\.(\d{1,5})$/ ) {
} elsif ( $lookup =~ /^([0-9a-f]+[0-9a-f:]+)\.(\d{1,5})/ ) {
$ip = $1;
# IPv6 ICMP
} elsif ( $lookup =~ /^([0-9a-f]+[0-9a-f:]+)\.(\d+\.\d+)$/ ) {
} elsif ( $lookup =~ /^([0-9a-f]+[0-9a-f:]+)\.(\d+\.\d+)/ ) {
$ip = $1;
# IPv6
} elsif ( $lookup =~ /^([0-9a-f]+[0-9a-f:]+)$/ ) {
} elsif ( $lookup =~ /^([0-9a-f]+[0-9a-f:]+)/ ) {
$ip = $1;
$port = 0;
} elsif ( $lookup =~ /^([0-9a-f]+[0-9a-f:]+\.\.[0-9a-f:]+)/ ) {
Expand Down
6 changes: 3 additions & 3 deletions libexec/NfProfile.pm
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,9 @@ sub ReadStatInfo {
my $err = undef;
my $args;
if ( defined $tend ) {
$args = "-I -R $NfConf::PROFILEDATADIR/$profilepath/$channel/$subdirs/nfcapd.$tstart:nfcapd.$tend";
$args = "-I -G none -R $NfConf::PROFILEDATADIR/$profilepath/$channel/$subdirs/nfcapd.$tstart:nfcapd.$tend";
} else {
$args = "-I -r $NfConf::PROFILEDATADIR/$profilepath/$channel/$subdirs/nfcapd.$tstart";
$args = "-I -G none -r $NfConf::PROFILEDATADIR/$profilepath/$channel/$subdirs/nfcapd.$tstart";
}
local $SIG{CHLD} = 'DEFAULT';
if ( !open(NFDUMP, "$NfConf::PREFIX/nfdump $args 2>&1 |") ) {
Expand Down Expand Up @@ -557,7 +557,7 @@ sub GetPeakValues {

my $tiso = NfSen::UNIX2ISO($t);
foreach my $ch ( @AllChannels ) {
my $args = "-I -r $NfConf::PROFILEDATADIR/$profilepath/$ch/$subdirs/nfcapd.$tiso";
my $args = "-I -G none -r $NfConf::PROFILEDATADIR/$profilepath/$ch/$subdirs/nfcapd.$tiso";

local $SIG{CHLD} = 'DEFAULT';
if ( !open(NFDUMP, "$NfConf::PREFIX/nfdump $args 2>&1 |") ) {
Expand Down

0 comments on commit f4a066e

Please sign in to comment.