Guy
as I have explained in my previous reply, I don't think you're going
to use simultaneously pcap_loop and pcap_next_pkt, so I don't see a
problem here. However, this problem can be overcome by an if statement
like the one below
if(buf == handle->buffer) { <--- we use the shared
buffer hence we have been called by pcap_loop etc.
/*
* Has "pcap_breakloop()" been called?
*/
if (handle->break_loop) {
/*
* Yes - clear the flag that indicates that it
* has, and return -2 as an indication that we
* were told to break out of the loop.
*/
handle->break_loop = 0;
return -2;
}
}
What do you think?
Regards, Luca
On Jan 1, 2008, at 10:24 PM, Guy Harris wrote:
Guy Harris wrote:
Unless I'm misinterpreting socket(7), at least on Linux systems
with the SO_TIMESTAMP socket option, you can set that option and
use recvmsg() to read a packet; the control message for the packet
will contain the time stamp.
...although that doesn't address the issue of the read-modify fields
in the pcap handle - which *are* significant, so the reentrancy
problem is, as Gregor notes, harder to fix.
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.