Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 May 2005 21:15:47 -0700
From:      Jon Simola <jsimola@gmail.com>
To:        Daniel Valencia <fetrovsky@yahoo.com>
Cc:        freebsd-net@freebsd.org
Subject:   Re: sending MAC packets --- again, and again
Message-ID:  <8eea040805052021151f0cdce7@mail.gmail.com>
In-Reply-To: <20050521031625.77340.qmail@web53907.mail.yahoo.com>
References:  <20050521031625.77340.qmail@web53907.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 5/20/05, Daniel Valencia <fetrovsky@yahoo.com> wrote:

> my sniffer just stalls and eventually will report a totally unrelated mes=
sage.
...
>         handle =3D pcap_open_live( "xl0", BUFSIZ, 1, 0, errbuf );

Uh, you're asking it to wait forever to see a packet. I don't see a
#define in there for BUFSIZ, so you might be asking it to catch zero
bytes. And what is the "totally unrelsated message"?

I'd try using pcap_loop() or friends so you can catch and examine more
than a single packet.

And don't forget to call pcap_close() at the end, I'm not sure how
polite pcap is about leaving dangling bpf devices.

--=20
Jon Simola
Systems Administrator
ABC Communications



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8eea040805052021151f0cdce7>