lkml.org 
[lkml]   [2013]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] tcp: add ability to set a timestamp offset (v2)

> diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
> index 086ceda..23f93d4 100644
> --- a/net/ipv4/tcp.c
> +++ b/net/ipv4/tcp.c
> @@ -2704,6 +2704,10 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
> else
> err = -EINVAL;
> break;
> + case TCP_TIMESTAMP:
> + tp->tsoffset = 0;
> + tp->tsoffset = val - tcp_time_stamp(tp);

I believe we should check that the socket state is TCP_CLOSE.
Otherwise tcp_time_stamp() readers might be surprised while
reading the value.

> + break;
> default:
> err = -ENOPROTOOPT;
> break;


\
 
 \ /
  Last update: 2013-01-23 17:02    [W:0.071 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site