aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-01-26 23:09:21 +0000
committerGuy Harris <guy@alum.mit.edu>2000-01-26 23:09:21 +0000
commitba520e3c93a706c717ccd4f3a0da663ca86999de (patch)
treeef210ad4018835e988e3705fb51617029aae617b
parent9f458a52fcf3a8fb5c028608c062b3929b6b3c36 (diff)
downloadwireshark-ba520e3c93a706c717ccd4f3a0da663ca86999de.tar.gz
wireshark-ba520e3c93a706c717ccd4f3a0da663ca86999de.tar.bz2
wireshark-ba520e3c93a706c717ccd4f3a0da663ca86999de.zip
In case the "ts" field of a libpcap per-packet header isn't a "struct
timeval" (if, say, it's a "struct bpf_timeval", with member sizes wired to 32 bits, as it appears to be in SuSE 6.3 and will, I think, be in the 0.5 release of libpcap), copy the members of that field to the "ts" field of the Wiretap per-packet header (which also lets us make it not a "struct timeval" as well). svn path=/trunk/; revision=1572
-rw-r--r--capture.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/capture.c b/capture.c
index 2f523e6c38..055a9bbfbd 100644
--- a/capture.c
+++ b/capture.c
@@ -1,7 +1,7 @@
/* capture.c
* Routines for packet capture windows
*
- * $Id: capture.c,v 1.91 2000/01/23 08:55:30 guy Exp $
+ * $Id: capture.c,v 1.92 2000/01/26 23:09:21 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -853,7 +853,12 @@ capture_pcap_cb(u_char *user, const struct pcap_pkthdr *phdr,
ld->go = FALSE;
}
if (ld->pdh) {
- whdr.ts = phdr->ts;
+ /* "phdr->ts" may not necessarily be a "struct timeval" - it may
+ be a "struct bpf_timeval", with member sizes wired to 32
+ bits - and we may go that way ourselves in the future, so
+ copy the members individually. */
+ whdr.ts.tv_sec = phdr->ts.tv_sec;
+ whdr.ts.tv_usec = phdr->ts.tv_usec;
whdr.caplen = phdr->caplen;
whdr.len = phdr->len;
whdr.pkt_encap = ld->linktype;