Skip Menu |

This queue is for tickets about the Net-Pcap CPAN distribution.

Report information
The Basics
Id: 31111
Status: resolved
Priority: 0/
Queue: Net-Pcap

People
Owner: Nobody in particular
Requestors: jaspax [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.14
Fixed in: 0.15



Subject: stats() func broken
The stats() func is broken pretty severely. The following perl program prints something like: 0.14 recv: 135607104, drop: 135585800, ifdrop: 3082111115 Even if the capture given on the command line only has a few packets. The numbers are different for different captures, but they're always very large and very wrong. ###### #!/usr/bin/perl use Net::Pcap; $err; $pcap = Net::Pcap::open_offline(shift, \$err) or die "$err\n"; %stat = (); Net::Pcap::stats($pcap, \%stat) or die "$!"; print "$Net::Pcap::VERSION\n"; print "recv: $stat{ps_recv}, drop: $stat{ps_drop}, ifdrop: $stat{ps_ifdrop}\n";
Subject: Re: [rt.cpan.org #31111] stats() func broken
Date: Sat, 01 Dec 2007 17:04:31 +0100
To: bug-Net-Pcap [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Show quoted text
> The stats() func is broken pretty severely. [...] > Even if the capture given on the command line only has a few packets. > The numbers are different for different captures, but they're always > very large and very wrong.
From the pcap(3) man: pcap_stats() is supported only on live captures, not on "savefiles"; no statistics are stored in "savefiles", so no statistics are available when reading from a "savefile". So it's not broken, you're just trying to use it in a way not supported by the underlying lib. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
Subject: Re: [rt.cpan.org #31111] stats() func broken
Date: Sat, 1 Dec 2007 11:11:01 -0800
To: bug-Net-Pcap [...] rt.cpan.org
From: "Jesse Bangs" <jaspax [...] gmail.com>
You're right. OTOH, shouldn't the stats() function maybe indicate this by returning an error, instead of successfully returning junk? That moved by ticket into the category of feature request. On 12/1/07, Sébastien Aperghis-Tramoni via RT <bug-Net-Pcap@rt.cpan.org> wrote: Show quoted text
> >
-- JS Bangs jaspax@gmail.com http://jaspax.com "amazing grace it sounds like razors in my ears that bell's been ringing now for years someday i'll give it all away that's how you sing amazing grace." - Low
Subject: Re: [rt.cpan.org #31111] stats() func broken
Date: Sun, 02 Dec 2007 02:52:29 +0100
To: bug-Net-Pcap [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Jesse Bangs wrote: Show quoted text
> You're right. OTOH, shouldn't the stats() function maybe indicate this > by returning an error, instead of successfully returning junk? That > moved by ticket into the category of feature request.
This will be documented in version 0.15 Thanks for your ticket. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
Subject: please ignore (test)
This is a test (rtconsole related) 2 attachments
{\rtf1\ansi\ansicpg1252\cocoartf949 {\fonttbl\f0\fswiss\fcharset0 Helvetica;} {\colortbl;\red255\green255\blue255;} \paperw11900\paperh16840\margl1440\margr1440\vieww9000\viewh8400\viewkind0 \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural \f0\fs24 \cf0 [This is a simple text attachment, RTF save]}
Download rtconsole.png
image/png 5.7k
rtconsole.png