Commit 62bc1c6d authored by David S. Miller's avatar David S. Miller Committed by Benjamin Herrenschmidt

[IPV4]: Do not return -EAGAIN on blocking UDP socket, noticed by Olaf Kirch.

parent 45cf898b
...@@ -787,6 +787,7 @@ int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, ...@@ -787,6 +787,7 @@ int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
if (flags & MSG_ERRQUEUE) if (flags & MSG_ERRQUEUE)
return ip_recv_error(sk, msg, len); return ip_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;
...@@ -852,7 +853,9 @@ int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, ...@@ -852,7 +853,9 @@ int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
skb_free_datagram(sk, skb); skb_free_datagram(sk, skb);
if (noblock)
return -EAGAIN; return -EAGAIN;
goto try_again;
} }
int udp_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) int udp_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
......
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