Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jbemmel committed Nov 7, 2023
1 parent 7930331 commit 8dbe4f4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 4 additions & 2 deletions tools/docker/containers/sflow-scripts/ixpmanager.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
</sql>

<ixp>
sflowtool = /usr/local/bin/sflowtool
sflowtool_opts = -4 -p 6343 -l
# sflowtool = /usr/bin/sflowtool
# sflowtool_opts = -4 -p 6343 -l
sflowtool = /usr/bin/goflow2
debug = 1
sflow_rrdcached = 1
sflow_rrddir = /data/ixpmatrix

Expand Down
10 changes: 7 additions & 3 deletions tools/runtime/sflow/goflow2-detect-ixp-bgp-sessions
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ while (<SFLOWTOOL>) {
my $srcip = $sample->{ SrcAddr };
my $dstip = $sample->{ DstAddr };

if ($ethertype eq '0x0800') {
if ($ethertype == 2048) {
$ipprotocol = 4;
} elsif ($ethertype eq '0x86dd') {
} elsif ($ethertype == 34525) { # 0x86dd
$ipprotocol = 6;
$srcip = NetAddr::IP->new($srcip)->short();
$dstip = NetAddr::IP->new($dstip)->short();
Expand All @@ -138,7 +138,7 @@ while (<SFLOWTOOL>) {
if ($protocol == 6 && ($srcport == 179 || $dstport == 179)) {
use NetPacket::TCP;

my $tcpflags = hex($sample->{TCPFlags});
my $tcpflags = hex($sample->{TcpFlags});

# we're only interested in established sessions
if (($tcpflags & ACK) && !(($tcpflags & SYN) || ($tcpflags & RST) ||($tcpflags & FIN))) {
Expand All @@ -158,6 +158,10 @@ while (<SFLOWTOOL>) {
print STDERR " ignored - no address match in database" if ($debug);
}
print STDERR ".\n" if ($debug);
} else {
if ($debug) {
print STDERR "DEBUG: ignoring [$srcip]:$srcport - [$dstip]:$dstport ".debug_tcpflags($tcpflags).".";
}
}
}

Expand Down

0 comments on commit 8dbe4f4

Please sign in to comment.