From d389424e00f9097cd24b3df4ca0ab7221f140eeb Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Thu, 22 Sep 2005 07:57:21 -0300 Subject: [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 --- net/llc/llc_sap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'net/llc/llc_sap.c') diff --git a/net/llc/llc_sap.c b/net/llc/llc_sap.c index 9f064b3a433..e6d538937f9 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; } -- cgit v1.2.3