Subject: net_disable_timestamp() needed when disable SO_TIMESTAMP?

From: "Andrew Brampton" <[email-masked]>
Date: Thu, 6 Mar 2008 15:55:33 -0000

Hi,
I'm new to the linux kernel, but I was trying to understand how the kernel 
records timestamps for each packets and this lead me to net/core/sock.c.

Now lines 610-624 (http://lxr.linux.no/linux/net/core/sock.c#L610 ) enable 
and disable SO_TIMESTAMP, and when enabling sock_enable_timestamp(sk) is 
called to enable time stamping on the socket. However 
sock_disable_timestamp() isn't called if SO_TIMESTAMP is being disabled. I 
was wondering if that was an over sight or done on purpose?

I see that sock_disable_timestamp() is eventually called when the socket is 
freed. I thought it might not be disabled in sock.c if for example it was 
enabled elsewhere, and it was unclear if it should be disabled or not?

Thanks for any clarity on this.
Andrew

P.S If it is a bug, I'm going to prepare my first kernel patch :)