Hi,
this patch fixes a bug in trunk where timestamping of packets does not
work if libpcap is run on vanilla kernel.
Signed-off-by: Arnd Hannemann <[EMAIL PROTECTED]>
diff -Naur a/userland/libpcap-0.9.4-ring/pcap-linux.c b/userland/libpcap-0.9.4-ring/pcap-linux.c
--- a/userland/libpcap-0.9.4-ring/pcap-linux.c 2007-07-18 16:43:24.000000000 +0200
+++ b/userland/libpcap-0.9.4-ring/pcap-linux.c 2007-07-19 15:33:21.000000000 +0200
@@ -707,16 +707,16 @@
}
}
-#ifndef HAVE_PF_RING
- /* Fill in our own header data */
- if (ioctl(handle->fd, SIOCGSTAMP, &pcap_header.ts) == -1) {
- snprintf(handle->errbuf, sizeof(handle->errbuf),
- "ioctl: %s", pcap_strerror(errno));
- return -1;
+ if (!handle->ring) {
+ /* Fill in our own header data */
+ if (ioctl(handle->fd, SIOCGSTAMP, &pcap_header.ts) == -1) {
+ snprintf(handle->errbuf, sizeof(handle->errbuf),
+ "ioctl: %s", pcap_strerror(errno));
+ return -1;
+ }
+ pcap_header.caplen = caplen;
+ pcap_header.len = packet_len;
}
- pcap_header.caplen = caplen;
- pcap_header.len = packet_len;
-#endif
/*
* Count the packet.
_______________________________________________
Ntop-dev mailing list
[email protected]
http://listgateway.unipi.it/mailman/listinfo/ntop-dev