diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2007-11-20 01:35:57 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:54:29 -0500 |
commit | 69d6da0b0faa70249a243a14e6066c013e9294e5 (patch) | |
tree | f3678fc834f0b7ba1fc46ef2a4a240e7a937d747 /net/ipv6/ip6_input.c | |
parent | 7bc54c90307b4bc3d7fb2ffd6ad8fbda0671a45e (diff) |
[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.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c index 79610b4bad3e..178aebc0427a 100644 --- a/net/ipv6/ip6_input.c +++ b/net/ipv6/ip6_input.c | |||
@@ -153,9 +153,8 @@ out: | |||
153 | static int ip6_input_finish(struct sk_buff *skb) | 153 | static int ip6_input_finish(struct sk_buff *skb) |
154 | { | 154 | { |
155 | struct inet6_protocol *ipprot; | 155 | struct inet6_protocol *ipprot; |
156 | struct sock *raw_sk; | ||
157 | unsigned int nhoff; | 156 | unsigned int nhoff; |
158 | int nexthdr; | 157 | int nexthdr, raw; |
159 | u8 hash; | 158 | u8 hash; |
160 | struct inet6_dev *idev; | 159 | struct inet6_dev *idev; |
161 | 160 | ||
@@ -171,9 +170,7 @@ resubmit: | |||
171 | nhoff = IP6CB(skb)->nhoff; | 170 | nhoff = IP6CB(skb)->nhoff; |
172 | nexthdr = skb_network_header(skb)[nhoff]; | 171 | nexthdr = skb_network_header(skb)[nhoff]; |
173 | 172 | ||
174 | raw_sk = sk_head(&raw_v6_htable[nexthdr & (MAX_INET_PROTOS - 1)]); | 173 | raw = raw6_local_deliver(skb, nexthdr); |
175 | if (raw_sk && !ipv6_raw_deliver(skb, nexthdr)) | ||
176 | raw_sk = NULL; | ||
177 | 174 | ||
178 | hash = nexthdr & (MAX_INET_PROTOS - 1); | 175 | hash = nexthdr & (MAX_INET_PROTOS - 1); |
179 | if ((ipprot = rcu_dereference(inet6_protos[hash])) != NULL) { | 176 | if ((ipprot = rcu_dereference(inet6_protos[hash])) != NULL) { |
@@ -206,7 +203,7 @@ resubmit: | |||
206 | else if (ret == 0) | 203 | else if (ret == 0) |
207 | IP6_INC_STATS_BH(idev, IPSTATS_MIB_INDELIVERS); | 204 | IP6_INC_STATS_BH(idev, IPSTATS_MIB_INDELIVERS); |
208 | } else { | 205 | } else { |
209 | if (!raw_sk) { | 206 | if (!raw) { |
210 | if (xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) { | 207 | if (xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) { |
211 | IP6_INC_STATS_BH(idev, IPSTATS_MIB_INUNKNOWNPROTOS); | 208 | IP6_INC_STATS_BH(idev, IPSTATS_MIB_INUNKNOWNPROTOS); |
212 | icmpv6_send(skb, ICMPV6_PARAMPROB, | 209 | icmpv6_send(skb, ICMPV6_PARAMPROB, |