Hi.
I'm making a prog in a red hat 7.0 box using pcap that int the main thread
creates another one, say thr1, wich in turn creates another one, say thr1_1.
Threads thr1 and ther1_1 have cleanup handlers. I experienced a good old
"segmentation faul" error when, in the signal catcher of the main thread, i
canceled thr1 wich in turns cancels thr1_1. It happened at the cleanup
handler of thr1 after the
pthread_cancel(thr1_1_TID);
and before the
pthread_join(thr1_1_TID, (void **) NULL)).
My feeling wad that a signal handler wich calls a cleanup handler wich calls
a secound cleanup handler was just to much and i changed the pcap_loop with
a pcap_dispatch in a
while(! signaled_to_finished)
loop. I works fine but it just get canceled after a packet is arrived
because neither pcap_loop nor pcap_dispatch return when a signal is rised.
How can i break a pcap_loop or a pcap_dispatch?
I searched for this topic and found nothing. I've got others apps that use
pcap but either have the same problem(dhcp_probe) or make the cleanup in the
signal catcher function(getdata).
I really apreciate some help on this cuz i have to have my prog finished in
one week. Glup.
Thanks in advance.
Telmo Oliveira
-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:[EMAIL PROTECTED]?body=unsubscribe