summaryrefslogtreecommitdiff
path: root/net/llc/llc_sap.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@mandriva.com>2005-09-22 07:57:21 -0300
committerArnaldo Carvalho de Melo <acme@mandriva.com>2005-09-22 07:57:21 -0300
commitd389424e00f9097cd24b3df4ca0ab7221f140eeb (patch)
tree9ffa95a4e791b19e5d793a06943e40221858b236 /net/llc/llc_sap.c
parent2928c19e1086e2f1e90d05931437ab6f1e4cfdc8 (diff)
downloadlwn-d389424e00f9097cd24b3df4ca0ab7221f140eeb.tar.gz
lwn-d389424e00f9097cd24b3df4ca0ab7221f140eeb.zip
[LLC]: Fix the accept path
Borrowing the structure of TCP/IP for this. On the receive of new connections I was bh_lock_socking the _new_ sock, not the listening one, duh, now it survives the ssh connections storm I've been using to test this specific bug. Also fixes send side skb sock accounting. Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Diffstat (limited to 'net/llc/llc_sap.c')
-rw-r--r--net/llc/llc_sap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/llc/llc_sap.c b/net/llc/llc_sap.c
index 9f064b3a4335..e6d538937f93 100644
--- a/net/llc/llc_sap.c
+++ b/net/llc/llc_sap.c
@@ -31,7 +31,7 @@
* Allocates an sk_buff for frame and initializes sk_buff fields.
* Returns allocated skb or %NULL when out of memory.
*/
-struct sk_buff *llc_alloc_frame(struct net_device *dev)
+struct sk_buff *llc_alloc_frame(struct sock *sk, struct net_device *dev)
{
struct sk_buff *skb = alloc_skb(128, GFP_ATOMIC);
@@ -41,6 +41,8 @@ struct sk_buff *llc_alloc_frame(struct net_device *dev)
skb->protocol = htons(ETH_P_802_2);
skb->dev = dev;
skb->mac.raw = skb->head;
+ if (sk != NULL)
+ skb_set_owner_w(skb, sk);
}
return skb;
}