Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 298786
b: refs/heads/master
c: 4a7e7c2
h: refs/heads/master
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Apr 6, 2012
1 parent 3241084 commit d079199
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 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: e34fac1c2e9ec531c2d63a5e3aa9a6d0ef36a1d3
refs/heads/master: 4a7e7c2ad540e54c75489a70137bf0ec15d3a127
24 changes: 13 additions & 11 deletions trunk/net/netlink/af_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -829,12 +829,19 @@ int netlink_attachskb(struct sock *sk, struct sk_buff *skb,
return 0;
}

int netlink_sendskb(struct sock *sk, struct sk_buff *skb)
static int __netlink_sendskb(struct sock *sk, struct sk_buff *skb)
{
int len = skb->len;

skb_queue_tail(&sk->sk_receive_queue, skb);
sk->sk_data_ready(sk, len);
return len;
}

int netlink_sendskb(struct sock *sk, struct sk_buff *skb)
{
int len = __netlink_sendskb(sk, skb);

sock_put(sk);
return len;
}
Expand Down Expand Up @@ -957,8 +964,7 @@ static int netlink_broadcast_deliver(struct sock *sk, struct sk_buff *skb)
if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf &&
!test_bit(0, &nlk->state)) {
skb_set_owner_r(skb, sk);
skb_queue_tail(&sk->sk_receive_queue, skb);
sk->sk_data_ready(sk, skb->len);
__netlink_sendskb(sk, skb);
return atomic_read(&sk->sk_rmem_alloc) > (sk->sk_rcvbuf >> 1);
}
return -1;
Expand Down Expand Up @@ -1698,10 +1704,8 @@ static int netlink_dump(struct sock *sk)

if (sk_filter(sk, skb))
kfree_skb(skb);
else {
skb_queue_tail(&sk->sk_receive_queue, skb);
sk->sk_data_ready(sk, skb->len);
}
else
__netlink_sendskb(sk, skb);
return 0;
}

Expand All @@ -1715,10 +1719,8 @@ static int netlink_dump(struct sock *sk)

if (sk_filter(sk, skb))
kfree_skb(skb);
else {
skb_queue_tail(&sk->sk_receive_queue, skb);
sk->sk_data_ready(sk, skb->len);
}
else
__netlink_sendskb(sk, skb);

if (cb->done)
cb->done(cb);
Expand Down

0 comments on commit d079199

Please sign in to comment.