Package: libpcap0.8-dev
Version: 0.9.8-5
Severity: normal
When using pcap_setfilter on the program below I get a valgrind error. I
do not get the error on my 64 bit system, only on my 32 bit system.
==1289== Syscall param socketcall.setsockopt(optval) points to uninitialised
byte(s)
==1289== at 0x4123EC2: setsockopt (in /usr/lib/debug/libc-2.7.so)
==1289== by 0x4034458: pcap_setfilter (in /usr/lib/libpcap.so.0.9.8)
==1289== by 0x8048759: main (pcap2.c:21)
==1289== Address 0xbefca27e is on thread 1's stack
#include <pcap.h>
main()
{
pcap_t *pcap;
struct bpf_program fp;
bpf_u_int32 deviceaddr, devicemask;
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;
}
if(pcap_lookupnet("eth0", &deviceaddr, &devicemask, errbuf) == -1) {
fputs("Couldn't get address of device eth0\n", stderr);
return 3;
}
if(pcap_compile(pcap, &fp, "tcp", 0, deviceaddr) >= 0) {
if(pcap_setfilter(pcap, &fp) < 0)
fputs("Error setting filter \"tcp\"\n", stderr);
} else
fputs("Error with pcap_compile\n", stderr);
pcap_close(pcap);
return 0;
}
-- System Information:
Debian Release: 5.0.1
APT prefers stable
APT policy: (500, 'stable')
Architecture: i386 (i686)
Kernel: Linux 2.6.26-2-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 [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]