Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 290224
b: refs/heads/master
c: 4934b03
h: refs/heads/master
v: v3
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Feb 21, 2012
1 parent d6d2614 commit fe9d939
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0b0a635f79f91f3755b6518627ea06dd0dbfd523
refs/heads/master: 4934b0329f7150dcb5f90506860e2db32274c755
9 changes: 5 additions & 4 deletions trunk/net/core/datagram.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,18 +180,19 @@ struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned flags,
* However, this function was correct in any case. 8)
*/
unsigned long cpu_flags;
struct sk_buff_head *queue = &sk->sk_receive_queue;

spin_lock_irqsave(&sk->sk_receive_queue.lock, cpu_flags);
skb = skb_peek(&sk->sk_receive_queue);
spin_lock_irqsave(&queue->lock, cpu_flags);
skb = skb_peek(queue);
if (skb) {
*peeked = skb->peeked;
if (flags & MSG_PEEK) {
skb->peeked = 1;
atomic_inc(&skb->users);
} else
__skb_unlink(skb, &sk->sk_receive_queue);
__skb_unlink(skb, queue);
}
spin_unlock_irqrestore(&sk->sk_receive_queue.lock, cpu_flags);
spin_unlock_irqrestore(&queue->lock, cpu_flags);

if (skb)
return skb;
Expand Down

0 comments on commit fe9d939

Please sign in to comment.