[PATCH net-next v6 1/2] tls: wait for receiving next skb for sk_redirect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Geliang Tang <tanggeliang@xxxxxxxxxx>

tls_sw_recvmsg() doesn't work in nonblock mode, it returns -EAGAIN in
that case. This patch fixes it, always wait for receiving the next skb
for sk_redirect.

Signed-off-by: Geliang Tang <tanggeliang@xxxxxxxxxx>
---
 net/tls/tls_sw.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index 305a412785f5..d2558856ceeb 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -2099,6 +2099,8 @@ int tls_sw_recvmsg(struct sock *sk,
 					rxm->full_len = 0;
 					if (err == __SK_DROP)
 						consume_skb(skb);
+					if (err == __SK_REDIRECT && flags & MSG_DONTWAIT)
+						tls_rx_rec_wait(sk, psock, false, released);
 					continue;
 				}
 			}
-- 
2.43.0





[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux