net: clear sk_err_soft in sk_clone_lock()
authorEric Dumazet <edumazet@google.com>
Fri, 28 Oct 2016 20:40:24 +0000 (13:40 -0700)
committerWilly Tarreau <w@1wt.eu>
Fri, 10 Feb 2017 10:03:53 +0000 (11:03 +0100)
commit9385be2ecff711df54a29af142efbf7391fbb37c
tree86c0cbc728ae2cdfa73949ee323260762c5a2024
parent0058a4c1b6209f86a29c4ecbca7e3ed55544d3b0
net: clear sk_err_soft in sk_clone_lock()

commit e551c32d57c88923f99f8f010e89ca7ed0735e83 upstream.

At accept() time, it is possible the parent has a non zero
sk_err_soft, leftover from a prior error.

Make sure we do not leave this value in the child, as it
makes future getsockopt(SO_ERROR) calls quite unreliable.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Willy Tarreau <w@1wt.eu>
net/core/sock.c