summaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_sockglue.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2023-08-18 19:41:45 +0200
committerDavid S. Miller <davem@davemloft.net>2023-08-20 16:17:47 +0200
commit0f158b32a9b146c9b86783efccfd9ed02c744623 (patch)
tree7b0a7ea12da8b4a7bc37f84cb9a9101ec80f60d5 /net/ipv4/ip_sockglue.c
parentMerge branch 'fixed_phy_register-return-value' (diff)
downloadlinux-0f158b32a9b146c9b86783efccfd9ed02c744623.tar.xz
linux-0f158b32a9b146c9b86783efccfd9ed02c744623.zip
net: selectively purge error queue in IP_RECVERR / IPV6_RECVERR
Setting IP_RECVERR and IPV6_RECVERR options to zero currently purges the socket error queue, which was probably not expected for zerocopy and tx_timestamp users. I discovered this issue while preparing commit 6b5f43ea0815 ("inet: move inet->recverr to inet->inet_flags"), I presume this change does not need to be backported to stable kernels. Add skb_errqueue_purge() helper to purge error messages only. Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Willem de Bruijn <willemb@google.com> Cc: Soheil Hassas Yeganeh <soheil@google.com> Reviewed-by: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_sockglue.c')
-rw-r--r--net/ipv4/ip_sockglue.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index 61b2e7bc7031..54ad0f0d5c2d 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -976,7 +976,7 @@ int do_ip_setsockopt(struct sock *sk, int level, int optname,
case IP_RECVERR:
inet_assign_bit(RECVERR, sk, val);
if (!val)
- skb_queue_purge(&sk->sk_error_queue);
+ skb_errqueue_purge(&sk->sk_error_queue);
return 0;
case IP_RECVERR_RFC4884:
if (val < 0 || val > 1)