From c9f3b70d22a4ae301f8f5c86f87c9f5f5a9229de Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 22 Feb 2002 11:49:13 +0000 Subject: The "sbh_timestamp" member of an "sb_hdr" structure isn't necessarily a "struct timeval" - on Solaris 7 and 8, when compiling in LP64 or I32LPx mode, it's a "struct timeval32" (presumably so that bufmod doesn't have to worry about whether the stream is being read by a 32-bit program or a 64-bit program). Set the "struct timeval" "pkthdr.ts" by copying the individual members rather than by doing a structure assignment. --- pcap-dlpi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'pcap-dlpi.c') diff --git a/pcap-dlpi.c b/pcap-dlpi.c index 3208ce3..fd31af6 100644 --- a/pcap-dlpi.c +++ b/pcap-dlpi.c @@ -38,7 +38,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/libpcap/pcap-dlpi.c,v 1.74 2001-12-10 07:14:15 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/libpcap/pcap-dlpi.c,v 1.75 2002-02-22 11:49:13 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -223,7 +223,8 @@ pcap_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user) ++p->md.stat.ps_recv; if (bpf_filter(fcode, pk, origlen, caplen)) { #ifdef HAVE_SYS_BUFMOD_H - pkthdr.ts = sbp->sbh_timestamp; + pkthdr.ts.tv_sec = sbp->sbh_timestamp.tv_sec; + pkthdr.ts.tv_usec = sbp->sbh_timestamp.tv_usec; #else (void)gettimeofday(&pkthdr.ts, NULL); #endif -- cgit v1.2.3