aboutsummaryrefslogtreecommitdiff
path: root/net/unix
diff options
context:
space:
mode:
authorGravatar Jakub Kicinski <kuba@kernel.org> 2024-04-18 13:10:20 -0700
committerGravatar Jakub Kicinski <kuba@kernel.org> 2024-04-18 13:12:24 -0700
commit41e3ddb291b8578c5c3b44def9cf3892fbc51838 (patch)
treefcca07ee3e511f97ed837aee324476e4ad3a8cd7 /net/unix
parentvirtio_net: Support RX hash XDP hint (diff)
parentMerge tag 'net-6.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netd... (diff)
downloadlinux-41e3ddb291b8578c5c3b44def9cf3892fbc51838.tar.gz
linux-41e3ddb291b8578c5c3b44def9cf3892fbc51838.tar.bz2
linux-41e3ddb291b8578c5c3b44def9cf3892fbc51838.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Cross-merge networking fixes after downstream PR. Conflicts: include/trace/events/rpcgss.h 386f4a737964 ("trace: events: cleanup deprecated strncpy uses") a4833e3abae1 ("SUNRPC: Fix rpcgss_context trace event acceptor field") Adjacent changes: drivers/net/ethernet/intel/ice/ice_tc_lib.c 2cca35f5dd78 ("ice: Fix checking for unsupported keys on non-tunnel device") 784feaa65dfd ("ice: Add support for PFCP hardware offload in switchdev") Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/unix')
-rw-r--r--net/unix/af_unix.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index ed16d5f66df8..dc1651541723 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -2617,7 +2617,9 @@ static struct sk_buff *manage_oob(struct sk_buff *skb, struct sock *sk,
WRITE_ONCE(u->oob_skb, NULL);
consume_skb(skb);
}
- } else if (!(flags & MSG_PEEK)) {
+ } else if (flags & MSG_PEEK) {
+ skb = NULL;
+ } else {
skb_unlink(skb, &sk->sk_receive_queue);
WRITE_ONCE(u->oob_skb, NULL);
if (!WARN_ON_ONCE(skb_unref(skb)))
@@ -2695,18 +2697,16 @@ redo:
last = skb = skb_peek(&sk->sk_receive_queue);
last_len = last ? last->len : 0;
+again:
#if IS_ENABLED(CONFIG_AF_UNIX_OOB)
if (skb) {
skb = manage_oob(skb, sk, flags, copied);
- if (!skb) {
+ if (!skb && copied) {
unix_state_unlock(sk);
- if (copied)
- break;
- goto redo;
+ break;
}
}
#endif
-again:
if (skb == NULL) {
if (copied >= target)
goto unlock;