Error in native code while shutting down an infinite capture
Brought to you by:
pcharles
When call capture(-1) is in effect and the thread that
runs it is interrupted, a native error in "capture"
function may occur.
By doing some "printf" style debugging, I traced the
error to line ~388 of file
jpcap/src/java/net/sourceforge/jpcap/capture/jpcap.c
The line says:
FD_SET(pcap_fileno(PD[instance]), &fd_wait);
It turns out that pcap_fileno returns garbage during
shutdown. To avoid this, I noticed that pcap_fileno is
returning a constant, and stored it's return value
outside the enclosing loop. I am attaching the patch.
Since I am not a pcap expert, I don't know if I haven't
broken anything by doing so (everything seems to work,
though).
My operating system is Linux Fedora Core 2. Java VM is
Sun 1.4.2.
The patch for the jpcap.c file.
Logged In: YES
user_id=1262793
Originator: NO
This has been addressed in the forthcoming release 2.0.