[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <51000131.3070300@parallels.com>
Date: Wed, 23 Jan 2013 19:26:41 +0400
From: Pavel Emelyanov <xemul@...allels.com>
To: Andrey Vagin <avagin@...nvz.org>
CC: netdev@...r.kernel.org, criu@...nvz.org,
linux-kernel@...r.kernel.org,
"David S. Miller" <davem@...emloft.net>,
Alexey Kuznetsov <kuznet@....inr.ac.ru>,
James Morris <jmorris@...ei.org>,
Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
Patrick McHardy <kaber@...sh.net>,
Eric Dumazet <edumazet@...gle.com>,
Yuchung Cheng <ycheng@...gle.com>,
Neal Cardwell <ncardwell@...gle.com>,
Dave Jones <davej@...hat.com>,
Michael Kerrisk <mtk.manpages@...il.com>
Subject: Re: [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;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists