On Wed, Oct 10, 2001 at 11:13:10AM -0400, Rip Toren wrote:
>   On Sept 18th I upgraded to libpcap 6.2. At the same time a program
> named 'divine' stopped working normally. Divine xmits arps and uses
> libpcap to find responses in order to configure a laptops network
> interface. the system is 4.3-RELEASE FreeBSD.

The only differences between the libpcap 0.4 "pcap-bpf.c" and the
libpcap 0.6.2 "pcap-bpf.c" are:

        a number of changes to use "snprintf()" rather than "sprintf()";

        an increase in the size of the buffer used to hold the name of
        the BPF device being opened;

        a change of a "bzero()" call to a "memset()" call;

        a change to try to find a kernel buffer size that works;

        added support for some DLT_ types;

        some AIX-specific changes;

        changes to the code installs the BPF filter, which now doesn't
        install the kernel filter if optimization was on and
        "gen_protochain()" was used (because that code doesn't work on
        some kernel BPFs).

Most of those changes shouldn't have an effect; perhaps some of them
might, but that seems unlikely.

Note, however:

>   /* one thread for arp, one for capture */
>   if (pthread_create(&t,0,send_arps,0)) {
>     fprintf(stdout,"Thread creation failed.\n");
>     exit(1);
>   }

that, on FreeBSD, there is a reasonable chance that libpcap code linked
with the standard pthreads library will *NOT* work, as the standard
pthreads library relies on "select()" on file descriptors in
non-blocking mode working correctly, but "select()" *doesn't* work on
BPF devices - the "select()" doesn't indicate that the descriptor is
ready for reading until the kernel buffer fills up; the timeout has no
effect, as the timer isn't started by a "select()" call.

As such, I'm somewhat surprised that your program *ever* worked.  It
might be interesting to run it under "truss" with both whatever libpcap
you were using before the upgrade and the current libpcap, to find out
why it worked before the upgrade and didn't work after the upgrade.
-
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

Reply via email to