Re: Fire Engine??

Jamie Lokier
2003-11-26T23:44:34Z

David S. Miller wrote:
> > recvmsg() doesn't return timestamps until they are requested
> > using setsockopt(...SO_TIMESTAMP...).
> >
> > See sock_recv_timestamp() in include/net/sock.h.
>
> See MSG_ERRQUEUE and net/ipv4/ip_sockglue.c

I don't see your point. The test for the SO_TIMESTAMP socket option
is _inside_ sock_recv_timestamp() (the flag is called sk_rcvtstamp).

The MSG_ERRQUEUE code simply calls sock_recv_timestamp(), which in
turn only reports the timestamp if the flag is set.

There are exactly two places where the timestamp is reported to
userspace, and both are at the request of userspace:

1. sock_recv_timestamp(), called from many places including
ip_sockglue.c. It _only_ reports it if SO_TIMESTAMP is
enabled for the socket.

2. inet_ioctl(SIOCGSTAMP)

Nowhere else is the timestamp reported to userspace.

-- Jamie