[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>
This commit is contained in:
Arnaldo Carvalho de Melo
2005-09-22 07:57:21 -03:00
parent 2928c19e10
commit d389424e00
7 changed files with 133 additions and 94 deletions
+3 -1
View File
@@ -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;
}