sctp: use the same clock as if sock source timestamps were on
authorMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Fri, 4 Dec 2015 17:14:03 +0000 (15:14 -0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Jan 2016 04:34:53 +0000 (20:34 -0800)
commitf580d5c5de89593d6d3785340979df61c972769d
treec3dd30952be8c6b8b3385a10183945822f720614
parent1fc94079ffc2e2ea213b7068385a38f4687bd4fa
sctp: use the same clock as if sock source timestamps were on

[ Upstream commit cb5e173ed7c03a0d4630ce68a95a186cce3cc872 ]

SCTP echoes a cookie o INIT ACK chunks that contains a timestamp, for
detecting stale cookies. This cookie is echoed back to the server by the
client and then that timestamp is checked.

Thing is, if the listening socket is using packet timestamping, the
cookie is encoded with ktime_get() value and checked against
ktime_get_real(), as done by __net_timestamp().

The fix is to sctp also use ktime_get_real(), so we can compare bananas
with bananas later no matter if packet timestamping was enabled or not.

Fixes: 52db882f3fc2 ("net: sctp: migrate cookie life from timeval to ktime")
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/sctp/sm_make_chunk.c