Commit 4183b994 authored by David S. Miller's avatar David S. Miller Committed by Patrick McHardy

[IPV6]: UDPv6 needs recvmsg csum error path fix too, thanks Olaf.

parent 1caf9958
...@@ -381,6 +381,7 @@ static int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk, ...@@ -381,6 +381,7 @@ static int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk,
if (flags & MSG_ERRQUEUE) if (flags & MSG_ERRQUEUE)
return ipv6_recv_error(sk, msg, len); return ipv6_recv_error(sk, msg, len);
try_again:
skb = skb_recv_datagram(sk, flags, noblock, &err); skb = skb_recv_datagram(sk, flags, noblock, &err);
if (!skb) if (!skb)
goto out; goto out;
...@@ -458,12 +459,13 @@ static int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk, ...@@ -458,12 +459,13 @@ static int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk,
kfree_skb(skb); kfree_skb(skb);
} }
/* Error for blocking case is chosen to masquerade skb_free_datagram(sk, skb);
as some normal condition.
*/ if (flags & MSG_DONTWAIT) {
err = (flags&MSG_DONTWAIT) ? -EAGAIN : -EHOSTUNREACH;
UDP6_INC_STATS_USER(UdpInErrors); UDP6_INC_STATS_USER(UdpInErrors);
goto out_free; return -EAGAIN;
}
goto try_again;
} }
static void udpv6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, static void udpv6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment