aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/netlink/af_netlink.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index b40c9a976969..4b91f4b84cb7 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -697,7 +697,6 @@ static __inline__ int netlink_broadcast_deliver(struct sock *sk, struct sk_buff
697 697
698 if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf && 698 if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf &&
699 !test_bit(0, &nlk->state)) { 699 !test_bit(0, &nlk->state)) {
700 skb_orphan(skb);
701 skb_set_owner_r(skb, sk); 700 skb_set_owner_r(skb, sk);
702 skb_queue_tail(&sk->sk_receive_queue, skb); 701 skb_queue_tail(&sk->sk_receive_queue, skb);
703 sk->sk_data_ready(sk, skb->len); 702 sk->sk_data_ready(sk, skb->len);
@@ -736,11 +735,15 @@ static inline int do_one_broadcast(struct sock *sk,
736 735
737 sock_hold(sk); 736 sock_hold(sk);
738 if (p->skb2 == NULL) { 737 if (p->skb2 == NULL) {
739 if (atomic_read(&p->skb->users) != 1) { 738 if (skb_shared(p->skb)) {
740 p->skb2 = skb_clone(p->skb, p->allocation); 739 p->skb2 = skb_clone(p->skb, p->allocation);
741 } else { 740 } else {
742 p->skb2 = p->skb; 741 p->skb2 = skb_get(p->skb);
743 atomic_inc(&p->skb->users); 742 /*
743 * skb ownership may have been set when
744 * delivered to a previous socket.
745 */
746 skb_orphan(p->skb2);
744 } 747 }
745 } 748 }
746 if (p->skb2 == NULL) { 749 if (p->skb2 == NULL) {