diff options
author | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2005-12-26 23:42:22 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-01-03 16:11:19 -0500 |
commit | 25995ff577675b58dbd848b7758e7bad87411947 (patch) | |
tree | 4d47595b01f8645552fa8af7b2be2019f133fefb /drivers/net/pppoe.c | |
parent | ce1d4d3e88b3a69d23c3feb436a0b36b6ca0642b (diff) |
[SOCK]: Introduce sk_receive_skb
Its common enough to to justify that, TCP still can't use it as it has the
prequeueing stuff, still to be made generic in the not so distant future :-)
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/pppoe.c')
-rw-r--r-- | drivers/net/pppoe.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c index a842ecc60a34..71e303b28646 100644 --- a/drivers/net/pppoe.c +++ b/drivers/net/pppoe.c | |||
@@ -383,8 +383,6 @@ static int pppoe_rcv(struct sk_buff *skb, | |||
383 | { | 383 | { |
384 | struct pppoe_hdr *ph; | 384 | struct pppoe_hdr *ph; |
385 | struct pppox_sock *po; | 385 | struct pppox_sock *po; |
386 | struct sock *sk; | ||
387 | int ret; | ||
388 | 386 | ||
389 | if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr))) | 387 | if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr))) |
390 | goto drop; | 388 | goto drop; |
@@ -395,24 +393,8 @@ static int pppoe_rcv(struct sk_buff *skb, | |||
395 | ph = (struct pppoe_hdr *) skb->nh.raw; | 393 | ph = (struct pppoe_hdr *) skb->nh.raw; |
396 | 394 | ||
397 | po = get_item((unsigned long) ph->sid, eth_hdr(skb)->h_source); | 395 | po = get_item((unsigned long) ph->sid, eth_hdr(skb)->h_source); |
398 | if (!po) | 396 | if (po != NULL) |
399 | goto drop; | 397 | return sk_receive_skb(sk_pppox(po), skb); |
400 | |||
401 | sk = sk_pppox(po); | ||
402 | bh_lock_sock(sk); | ||
403 | |||
404 | /* Socket state is unknown, must put skb into backlog. */ | ||
405 | if (sock_owned_by_user(sk) != 0) { | ||
406 | sk_add_backlog(sk, skb); | ||
407 | ret = NET_RX_SUCCESS; | ||
408 | } else { | ||
409 | ret = pppoe_rcv_core(sk, skb); | ||
410 | } | ||
411 | |||
412 | bh_unlock_sock(sk); | ||
413 | sock_put(sk); | ||
414 | |||
415 | return ret; | ||
416 | drop: | 398 | drop: |
417 | kfree_skb(skb); | 399 | kfree_skb(skb); |
418 | out: | 400 | out: |