sending MAC packets --- again, and again

Jon Simola jsimola at gmail.com
Fri May 20 21:15:48 PDT 2005


On 5/20/05, Daniel Valencia <fetrovsky at yahoo.com> wrote:

> my sniffer just stalls and eventually will report a totally unrelated message.
...
>         handle = 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.

-- 
Jon Simola
Systems Administrator
ABC Communications


More information about the freebsd-net mailing list