Menu

#39 Error in native code while shutting down an infinite capture

open
nobody
None
5
2013-01-24
2005-06-23
No

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.

Discussion

  • Klemen Zagar

    Klemen Zagar - 2005-06-23

    The patch for the jpcap.c file.

     
  • EJP

    EJP - 2008-08-20

    Logged In: YES
    user_id=1262793
    Originator: NO

    This has been addressed in the forthcoming release 2.0.

     

Log in to post a comment.

MongoDB Logo MongoDB