Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: Brian Hazzard <hazzard@ll.mit.edu>
Subject: tcpdump/packet_ioctl: SIOCGSTAMP
Date: 1999/07/20	[thread overview]
Message-ID: <37948138.FFE86A21@ll.mit.edu> (raw)

Hi,

I am running tcpdump on an alpha running linux 2.2.10.  
The tcpdump timestamp is in seconds.  Has anyone been able to
get usec timestamps on linux alphas???

Thanks,
Brian

PS. I am running tcpdump-3.4 and libpcap-0.4.  libpcap makes an ioctl
to packet_ioctl (in af_packet.c) to get the timestamp 
(passing a reference to a timeval structure).  Inserting a 
printk in af_packet.c for the SIOCGSTAMP ioctl shows both 
the sk->stamp.tv_sec and sk->stamp.tv_usec fields are
filled in.  Unfortunately, inserting a printf after the ioctl call 
in libpcap shows the usec field is zero.  Is there a problem with 
passing data structures this way using copy_to_user for alphas?

from libpcap
-----------------
                /* Get timestamp */
                if (ioctl(p->fd, SIOCGSTAMP, &h.ts) < 0) {
                        sprintf(p->errbuf, "SIOCGSTAMP: %s",
                            pcap_strerror(errno));
                        return (-1);
                }
from af_packet.c
-----------------
                case SIOCGSTAMP:
                        if(sk->stamp.tv_sec==0)
                                return -ENOENT;
                        err = -EFAULT;

                        if (!copy_to_user((void *)arg, &sk->stamp,
sizeof(struct timeval)))
                                err = 0;
                        return err;



                 reply	other threads:[~1999-07-20  4:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox