Hi,
I'm using the following piece of code to record the received time of my
packets.
struct timeval tv = {0,0};
if ( ioctl(s, SIOCGSTAMP, &tv) )
return 0;
When I use UDP this is all great, but when I use TCP this stops working. I
have since found out that I can't use this for TCP packets[1], but the
reason I'm writing this email is because ioctl returns zero when using TCP
and tv has a odd value in it. tv.tv_sec = -2, and tv.tv_usec = 999999.
Now I assume -2 is some kind of error code, so I dug into the linux code to
try and figure out what it means. The ioctl eventually calls
sock_get_timestamp() which in turn calls ktime_to_timeval. I can see in
sock_get_timestamp() that tv_sec is compared to -1 and ioctl returns an
error, however I can not find where tv_sec is set to -2. If -2 is another
error code then it should be checked inside sock_get_timestamp().
So I'm wondering if this is a bug in the kernel somewhere, or should I just
expect ioctl to fail yet return 0? I have not included a test app, but if
you want I'll be happy to code a short app to show this problem, but the
critital lines are the ioctl call and that a TCP socket is used. This occurs
on both the 2.6.22-3-amd64 kernel as well as on 2.6.24.
Thanks
Andrew
[1] http://www.ussg.iu.edu/hypermail/linux/kernel/0301.2/1248.html
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
| Karl Meyer | PROBLEM: 2.6.23-rc "NETDEV WATCHDOG: eth0: transmit timed out" |
| Greg Kroah-Hartman | [PATCH 040/196] kobject: add kobject_add_ng function |
| Steven Rostedt | [RFC PATCH v4] Unified trace buffer |
| Dave Airlie | [git pull] drm patches for 2.6.27 final |
| Krzysztof Halasa | Re: [PATCH v2] Re: WAN: new PPP code for generic HDLC |
| David Miller | Re: [PATCH] Expose netdevice dev_id through sysfs |
| Jay Cliburn | Re: atl1 64-bit => 32-bit DMA borkage (reproducible, bisected) |
| Evgeniy Polyakov | [resend take 2 0/4] Distributed storage. |
git: | |
| Andrew Morton | Untracked working tree files |
| Miklos Vajna | [rfc] git submodules howto |
| Ben Collins | Re: [kernel.org users] [RFD] On deprecating "git-foo" for builtins |
| Jon Smirl | ! [rejected] master -> master (non-fast forward) |
| rancor | How to copy/pipe console buffert to file? |
| Pieter Verberne | File collision while using pkg_add |
| Greg Thomas | Re: Is it possible to fix a stale NFS hadle without rebooting? |
| Didier Wiroth | win32-codecs, avi and amd64 question |
| Netfilter kernel module | 9 hours ago | Linux kernel |
| serial driver xmit problem | 12 hours ago | Linux kernel |
| Why Windows is better than Linux | 12 hours ago | Linux general |
| How can I see my kernel messages in vt12? | 19 hours ago | Linux kernel |
| Grub | 1 day ago | Linux general |
| vmalloc_fault handling in x86_64 | 1 day ago | Linux kernel |
| epoll_wait()ing on epoll FD | 1 day ago | Linux kernel |
| Framebuffer in x86_64 causes problems to multiseat | 1 day ago | Linux kernel |
| Difference between 2.4 and 2.6 regarding thread creation | 1 day ago | Linux general |
| Compiling gfs2 on kernel 2.6.27 | 2 days ago | Linux kernel |
