summaryrefslogtreecommitdiff
path: root/net/ipv6/ip6_input.c
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2007-11-20 06:35:57 (GMT)
committerDavid S. Miller <davem@davemloft.net>2008-01-28 22:54:29 (GMT)
commit69d6da0b0faa70249a243a14e6066c013e9294e5 (patch)
treef3678fc834f0b7ba1fc46ef2a4a240e7a937d747 /net/ipv6/ip6_input.c
parent7bc54c90307b4bc3d7fb2ffd6ad8fbda0671a45e (diff)
downloadlinux-69d6da0b0faa70249a243a14e6066c013e9294e5.tar.xz
[IPv6] RAW: Compact the API for the kernel
Same as in the previous patch for ipv4, compact the API and hide hash table and rwlock inside the raw.c file. Plus fix some "bad" places from checkpatch.pl point of view (assignments inside if()). Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6_input.c')
-rw-r--r--net/ipv6/ip6_input.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
index 79610b4..178aebc 100644
--- a/net/ipv6/ip6_input.c
+++ b/net/ipv6/ip6_input.c
@@ -153,9 +153,8 @@ out:
static int ip6_input_finish(struct sk_buff *skb)
{
struct inet6_protocol *ipprot;
- struct sock *raw_sk;
unsigned int nhoff;
- int nexthdr;
+ int nexthdr, raw;
u8 hash;
struct inet6_dev *idev;
@@ -171,9 +170,7 @@ resubmit:
nhoff = IP6CB(skb)->nhoff;
nexthdr = skb_network_header(skb)[nhoff];
- raw_sk = sk_head(&raw_v6_htable[nexthdr & (MAX_INET_PROTOS - 1)]);
- if (raw_sk && !ipv6_raw_deliver(skb, nexthdr))
- raw_sk = NULL;
+ raw = raw6_local_deliver(skb, nexthdr);
hash = nexthdr & (MAX_INET_PROTOS - 1);
if ((ipprot = rcu_dereference(inet6_protos[hash])) != NULL) {
@@ -206,7 +203,7 @@ resubmit:
else if (ret == 0)
IP6_INC_STATS_BH(idev, IPSTATS_MIB_INDELIVERS);
} else {
- if (!raw_sk) {
+ if (!raw) {
if (xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) {
IP6_INC_STATS_BH(idev, IPSTATS_MIB_INUNKNOWNPROTOS);
icmpv6_send(skb, ICMPV6_PARAMPROB,