lkml.org 
[lkml]   [2003]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Fire Engine??
David S. Miller wrote:
>
> Andi, I know this is a problem, but for the millionth time your idea
> does not work because we don't know if the user asked for the timestamp
> until we are deep within the recvmsg() processing, which is long after
> the packet has arrived.

How about tracking the number of current sockets that have had timestamp
requests for them? If this number is zero, don't bother with the
timestamps. The first time you get a SIOCGSTAMP ioctl on a given socket,
bump the count and set a flag; decrement the count when the socket is
destroyed if the flag is set.

The drawback is that the first SIOCGSTAMP on any particular socket will
have to return a bogus value (maybe just the current time?). Ways to
mitigate that are:

- have a /proc option to let the sysadmin enforce timestamps on all
packets (just bump the counter)

- bump the counter whenever an interface is in promiscuous mode (I
imagine that tcpdump et al are the main users of the timestamps?)

Paul

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:58    [W:0.110 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site