summaryrefslogtreecommitdiffstats
path: root/drivers/net/pppoe.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@mandriva.com>2005-12-27 02:42:22 -0200
committerDavid S. Miller <davem@sunset.davemloft.net>2006-01-03 13:11:19 -0800
commit25995ff577675b58dbd848b7758e7bad87411947 (patch)
tree4d47595b01f8645552fa8af7b2be2019f133fefb /drivers/net/pppoe.c
parentce1d4d3e88b3a69d23c3feb436a0b36b6ca0642b (diff)
downloadop-kernel-dev-25995ff577675b58dbd848b7758e7bad87411947.zip
op-kernel-dev-25995ff577675b58dbd848b7758e7bad87411947.tar.gz
[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.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c
index a842ecc..71e303b 100644
--- a/drivers/net/pppoe.c
+++ b/drivers/net/pppoe.c
@@ -383,8 +383,6 @@ static int pppoe_rcv(struct sk_buff *skb,
{
struct pppoe_hdr *ph;
struct pppox_sock *po;
- struct sock *sk;
- int ret;
if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr)))
goto drop;
@@ -395,24 +393,8 @@ static int pppoe_rcv(struct sk_buff *skb,
ph = (struct pppoe_hdr *) skb->nh.raw;
po = get_item((unsigned long) ph->sid, eth_hdr(skb)->h_source);
- if (!po)
- goto drop;
-
- sk = sk_pppox(po);
- bh_lock_sock(sk);
-
- /* Socket state is unknown, must put skb into backlog. */
- if (sock_owned_by_user(sk) != 0) {
- sk_add_backlog(sk, skb);
- ret = NET_RX_SUCCESS;
- } else {
- ret = pppoe_rcv_core(sk, skb);
- }
-
- bh_unlock_sock(sk);
- sock_put(sk);
-
- return ret;
+ if (po != NULL)
+ return sk_receive_skb(sk_pppox(po), skb);
drop:
kfree_skb(skb);
out:
OpenPOWER on IntegriCloud