]> git.baikalelectronics.ru Git - kernel.git/commit
sock: reset sk_err when the error queue is empty
authorSoheil Hassas Yeganeh <soheil@google.com>
Fri, 2 Jun 2017 16:38:22 +0000 (12:38 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Jun 2017 00:01:53 +0000 (20:01 -0400)
commit0c8b168b8a6df509324ee280e76a9f79c1e3249c
treeddd35c10ba411c39ac7cf0f39857bd00b4b62ad2
parent87a3010733a8e86584bee43e23edda29c33732f7
sock: reset sk_err when the error queue is empty

Prior to 28ad2c3cbaf9 (sock: do not set sk_err in
sock_dequeue_err_skb), sk_err was reset to the error of
the skb on the head of the error queue.

Applications, most notably ping, are relying on this
behavior to reset sk_err for ICMP packets.

Set sk_err to the ICMP error when there is an ICMP packet
at the head of the error queue.

Fixes: 28ad2c3cbaf9 (sock: do not set sk_err in sock_dequeue_err_skb)
Reported-by: Cyril Hrubis <chrubis@suse.cz>
Tested-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/skbuff.c