diff options
author | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2005-12-27 02:42:22 -0200 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-01-03 13:11:19 -0800 |
commit | 25995ff577675b58dbd848b7758e7bad87411947 (patch) | |
tree | 4d47595b01f8645552fa8af7b2be2019f133fefb /net/dccp | |
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 'net/dccp')
-rw-r--r-- | net/dccp/ipv4.c | 23 | ||||
-rw-r--r-- | net/dccp/ipv6.c | 17 |
2 files changed, 3 insertions, 37 deletions
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index c363051a7f1..99e8afa7ba1 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c @@ -914,7 +914,6 @@ int dccp_v4_rcv(struct sk_buff *skb) { const struct dccp_hdr *dh; struct sock *sk; - int rc; /* Step 1: Check header basics: */ @@ -984,28 +983,10 @@ int dccp_v4_rcv(struct sk_buff *skb) goto do_time_wait; } - if (!xfrm4_policy_check(sk, XFRM_POLICY_IN, skb)) { - dccp_pr_debug("xfrm4_policy_check failed\n"); + if (!xfrm4_policy_check(sk, XFRM_POLICY_IN, skb)) goto discard_and_relse; - } - - if (sk_filter(sk, skb, 0)) { - dccp_pr_debug("sk_filter failed\n"); - goto discard_and_relse; - } - - skb->dev = NULL; - bh_lock_sock(sk); - rc = 0; - if (!sock_owned_by_user(sk)) - rc = dccp_v4_do_rcv(sk, skb); - else - sk_add_backlog(sk, skb); - bh_unlock_sock(sk); - - sock_put(sk); - return rc; + return sk_receive_skb(sk, skb); no_dccp_socket: if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index 599b0be2151..2e194c8f995 100644 --- a/net/dccp/ipv6.c +++ b/net/dccp/ipv6.c @@ -1032,7 +1032,6 @@ static int dccp_v6_rcv(struct sk_buff **pskb, unsigned int *nhoffp) const struct dccp_hdr *dh; struct sk_buff *skb = *pskb; struct sock *sk; - int rc; /* Step 1: Check header basics: */ @@ -1077,21 +1076,7 @@ static int dccp_v6_rcv(struct sk_buff **pskb, unsigned int *nhoffp) if (!xfrm6_policy_check(sk, XFRM_POLICY_IN, skb)) goto discard_and_relse; - if (sk_filter(sk, skb, 0)) - goto discard_and_relse; - - skb->dev = NULL; - - bh_lock_sock(sk); - rc = 0; - if (!sock_owned_by_user(sk)) - rc = dccp_v6_do_rcv(sk, skb); - else - sk_add_backlog(sk, skb); - bh_unlock_sock(sk); - - sock_put(sk); - return rc ? -1 : 0; + return sk_receive_skb(sk, skb) ? -1 : 0; no_dccp_socket: if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) |