tcpdump mailing list archives

Re: libpcap & poll()


From: Ben Greear <greearb () candelatech com>
Date: Thu, 13 Nov 2008 13:34:27 -0800

Aaron Turner wrote:
I've been told by an end user under Linux 2.6.x at least that, he's
seeing very high CPU utilization numbers with tcpbridge which uses
libpcap to read packets.  Sounds like the cause of the issue is that
I'm using poll() to determine when to read from libpcap.  I'm using
poll() because my code listens on multiple interfaces, hence I need a
way to look at multiple pcap handles.

Questions basically boil down to:
1) Is this expected?
2) Is there a better way?

poll is good generally.

Are you reading multiple packets when poll says the descriptor
is readable?

If you set the descriptor to non-blocking mode, you can read as
many as are available each loop...

Thanks,
Ben


Thanks,
Aaron



--
Ben Greear <greearb () candelatech com>
Candela Technologies Inc  http://www.candelatech.com

-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: