* try harder to determine IP version for sFlow samples.

This commit is contained in:
Manuel Kasper 2013-04-15 16:14:23 +00:00
parent 1a0a153ec0
commit d88bb9b1d4

View File

@ -129,6 +129,13 @@ while (1) {
$ipversion = 6;
} else {
$noctets = $sFlowSample->{'HeaderFrameLength'} - 14;
# make one more attempt at figuring out the IP version
if ((defined($sFlowSample->{'GatewayIpVersionNextHopRouter'}) &&
$sFlowSample->{'GatewayIpVersionNextHopRouter'} == 2) ||
(defined($sFlowSample->{'HeaderType'}) && $sFlowSample->{'HeaderType'} eq '86dd')) {
$ipversion = 6;
}
}
my $srcas = 0;
@ -170,7 +177,7 @@ sub handleflow {
return;
}
#print "$srcas => $dstas ($noctets octets)\n";
#print "$srcas => $dstas ($noctets octets, in $snmpin, out $snmpout, version $ipversion)\n";
# determine direction and interface alias name (if known)
my $direction;