[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20160321.225749.1021493391392469038.davem@davemloft.net>
Date: Mon, 21 Mar 2016 22:57:49 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: deepa.kernel@...il.com
Cc: netdev@...r.kernel.org, y2038@...ts.linaro.org,
kuznet@....inr.ac.ru, yoshfuji@...ux-ipv6.org, jmorris@...ei.org,
kaber@...sh.net, arnd@...db.de
Subject: Re: [PATCH RESEND] net: ipv4: Fix truncated timestamp returned by
inet_current_timestamp()
From: Deepa Dinamani <deepa.kernel@...il.com>
Date: Mon, 21 Mar 2016 18:21:26 -0700
> The millisecond timestamps returned by the function is
> converted to network byte order by making a call to htons().
> htons() only returns __be16 while __be32 is required here.
>
> This was identified by the sparse warning from the buildbot:
> net/ipv4/af_inet.c:1405:16: sparse: incorrect type in return
> expression (different base types)
> net/ipv4/af_inet.c:1405:16: expected restricted __be32
> net/ipv4/af_inet.c:1405:16: got restricted __be16 [usertype] <noident>
>
> Change the function to use htonl() to return the correct __be32 type
> instead so that the millisecond value doesn't get truncated.
>
> Signed-off-by: Deepa Dinamani <deepa.kernel@...il.com>
> Cc: "David S. Miller" <davem@...emloft.net>
> Cc: Alexey Kuznetsov <kuznet@....inr.ac.ru>
> Cc: Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>
> Cc: James Morris <jmorris@...ei.org>
> Cc: Patrick McHardy <kaber@...sh.net>
> Cc: Arnd Bergmann <arnd@...db.de>
> Fixes: 822c868532ca ("net: ipv4: Convert IP network timestamps to be y2038 safe")
> Reported-by: Fengguang Wu <fengguang.wu@...el.com> [0-day test robot]
Applied and queued up for -stable.
Powered by blists - more mailing lists