Subject: | Net::Analysis::Listener::HTTP fails to echo TCP session start |
Module : Net::Analysis::Listener::HTTP
Version : Net-Analysis-0.40
Perl Version : v5.8.5 built for i386-linux-thread-multi
OS : Linux redacted 2.6.9-5.ELsmp #1 SMP Wed Jan 5 19:30:39 EST 2005
i686 i686 i386 GNU/Linux
When attempting to use the HTTP listener by running the following command :
sudo perl -MNet::Analysis -e main HTTP,v=7 "port 80"
each request results in output as follows with the contained error :
(starting live capture)
Listener '[Net::Analysis::Listener::HTTP]' die()d on method
tcp_session_start:
Can't coerce array into hash at
/usr/lib/perl5/site_perl/5.8.5/Net/Analysis/Listener/HTTP.pm line 63.
at /usr/lib/perl5/site_perl/5.8.5/Net/Analysis/Listener/Base.pm line 150
0.0009s : /
==== tcp session end [10.0.3.254:80-10.0.4.192:4761]
This is caused by line 63 which as of Net-Analysis-0.40 reads as :
$self->trace (" ==== tcp session start [$pkt->{from} ->
$pkt->{to}]");
and should read as :
$self->trace (" ==== tcp session start [".
$pkt->[PKT_SLOT_FROM]." -> ".
$pkt->[PKT_SLOT_TO]."]");
I'm attaching a patch which makes this change.
Subject: | Net-Analysis-0.40_HTTP.pm.patch |
--- /usr/lib/perl5/site_perl/5.8.5/Net/Analysis/Listener/HTTP.pm.BAK 2009-02-13 14:40:32.910343280 -0800
+++ /usr/lib/perl5/site_perl/5.8.5/Net/Analysis/Listener/HTTP.pm 2009-02-13 15:31:13.205148216 -0800
@@ -12,6 +12,7 @@
use Params::Validate qw(:all);
+use Net::Analysis::Packet qw(:all);
use base qw(Net::Analysis::Listener::Base);
# }}}
@@ -60,7 +61,9 @@
my $k = $args->{socketpair_key};
if ($self->{v} & 0x04) {
- $self->trace (" ==== tcp session start [$pkt->{from} -> $pkt->{to}]");
+ $self->trace (" ==== tcp session start [".
+ $pkt->[PKT_SLOT_FROM]." -> ".
+ $pkt->[PKT_SLOT_TO]."]");
}
}