Skip to content

Commit

Permalink
net: Fix inverted test in __skb_recv_datagram
Browse files Browse the repository at this point in the history
As the kernel generally uses negated error numbers, *err needs to be
compared with -EAGAIN (d'oh).

Signed-off-by: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Fixes: ea3793e ("core: enable more fine-grained datagram reception control")
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Rainer Weikusat authored and David S. Miller committed Dec 8, 2015
1 parent e72c932 commit 760a432
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/core/datagram.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned int flags,
if (skb)
return skb;

if (*err != EAGAIN)
if (*err != -EAGAIN)
break;
} while (timeo &&
!__skb_wait_for_more_packets(sk, err, &timeo, last));
Expand Down

0 comments on commit 760a432

Please sign in to comment.