Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90195
b: refs/heads/master
c: b1153f2
h: refs/heads/master
i:
  90193: fa42f63
  90191: 769d1e3
v: v3
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Mar 21, 2008
1 parent 0c801e9 commit 0f87473
Show file tree
Hide file tree
Showing 2 changed files with 24 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: 6f8b13bcb3369a5df2e63acc422bed6098f5b8c4
refs/heads/master: b1153f29ee07dc1a788964409255a4b4fae50b98
27 changes: 23 additions & 4 deletions trunk/net/netlink/af_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,13 @@ int netlink_unicast(struct sock *ssk, struct sk_buff *skb,
if (netlink_is_kernel(sk))
return netlink_unicast_kernel(sk, skb);

if (sk_filter(sk, skb)) {
int err = skb->len;
kfree_skb(skb);
sock_put(sk);
return err;
}

err = netlink_attachskb(sk, skb, nonblock, &timeo, ssk);
if (err == 1)
goto retry;
Expand Down Expand Up @@ -980,6 +987,9 @@ static inline int do_one_broadcast(struct sock *sk,
netlink_overrun(sk);
/* Clone failed. Notify ALL listeners. */
p->failure = 1;
} else if (sk_filter(sk, p->skb2)) {
kfree_skb(p->skb2);
p->skb2 = NULL;
} else if ((val = netlink_broadcast_deliver(sk, p->skb2)) < 0) {
netlink_overrun(sk);
} else {
Expand Down Expand Up @@ -1533,8 +1543,13 @@ static int netlink_dump(struct sock *sk)

if (len > 0) {
mutex_unlock(nlk->cb_mutex);
skb_queue_tail(&sk->sk_receive_queue, skb);
sk->sk_data_ready(sk, len);

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

Expand All @@ -1544,8 +1559,12 @@ static int netlink_dump(struct sock *sk)

memcpy(nlmsg_data(nlh), &len, sizeof(len));

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

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

0 comments on commit 0f87473

Please sign in to comment.