Package: libpcap0.8-dev
Version: 0.9.8-5
Severity: important

With the following program, about 50% of the time the pcap_next fails
        with "Error reading from eth0".
If you comment out the pcap_setdirection line you never get this, data is
always read.

#include <pcap.h>

main()
{
        pcap_t *pcap;
        const u_char *buffer;
        struct pcap_pkthdr header;
        char errbuf[PCAP_ERRBUF_SIZE];

        pcap = pcap_open_live("eth0", BUFSIZ, 1, 1000, errbuf);
        if(pcap == NULL) {
                fprintf(stderr, "eth0: %s\n", errbuf);
                return 1;
        }

        pcap_setdirection(pcap, PCAP_D_IN);
        buffer = pcap_next(pcap, &header);
        if(buffer == NULL) {
                fputs("Error reading from eth0\n", stderr);
                pcap_close(pcap);
                return 2;
        }
        pcap_close(pcap);
        printf("Read %d bytes\n", header.len);
        return 0;
}



-- System Information:
Debian Release: 5.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-1-686 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libpcap0.8-dev depends on:
ii  libc6-dev                     2.7-18     GNU C Library: Development Librari
ii  libpcap0.8                    0.9.8-5    system interface for user-level pa

libpcap0.8-dev recommends no packages.

libpcap0.8-dev suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to