diff --git a/net/xfrm/espintcp.c b/net/xfrm/espintcp.c index 5a0ff665b71a8..024470fb2d856 100644 --- a/net/xfrm/espintcp.c +++ b/net/xfrm/espintcp.c @@ -101,8 +101,11 @@ static int espintcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, flags |= nonblock ? MSG_DONTWAIT : 0; skb = __skb_recv_datagram(sk, &ctx->ike_queue, flags, &off, &err); - if (!skb) + if (!skb) { + if (err == -EAGAIN && sk->sk_shutdown & RCV_SHUTDOWN) + return 0; return err; + } copied = len; if (copied > skb->len)