diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-04-10 02:41:26 -0400 |
---|---|---|
committer | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-04-11 06:47:49 -0400 |
commit | aba6096b21e151bc55da74605fe77b92cfcccb12 (patch) | |
tree | 420797fd939fff324c65913c3dc9f10deff5ff73 | |
parent | c0b8c32b1c96afc9b32b717927330025cc1c501e (diff) |
[IPV6]: Kill several warnings without CONFIG_IPV6_MROUTE.
Pointed out by Andrew Morton <akpm@linux-foundation.org>.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
-rw-r--r-- | net/ipv6/ip6_input.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c index 09a3201e408a..4e5c8615832c 100644 --- a/net/ipv6/ip6_input.c +++ b/net/ipv6/ip6_input.c | |||
@@ -262,21 +262,23 @@ int ip6_mc_input(struct sk_buff *skb) | |||
262 | * is for MLD (0x0000). | 262 | * is for MLD (0x0000). |
263 | */ | 263 | */ |
264 | if ((ptr[2] | ptr[3]) == 0) { | 264 | if ((ptr[2] | ptr[3]) == 0) { |
265 | deliver = 0; | ||
266 | |||
265 | if (!ipv6_ext_hdr(nexthdr)) { | 267 | if (!ipv6_ext_hdr(nexthdr)) { |
266 | /* BUG */ | 268 | /* BUG */ |
267 | goto discard; | 269 | goto out; |
268 | } | 270 | } |
269 | offset = ipv6_skip_exthdr(skb, sizeof(*hdr), | 271 | offset = ipv6_skip_exthdr(skb, sizeof(*hdr), |
270 | &nexthdr); | 272 | &nexthdr); |
271 | if (offset < 0) | 273 | if (offset < 0) |
272 | goto discard; | 274 | goto out; |
273 | 275 | ||
274 | if (nexthdr != IPPROTO_ICMPV6) | 276 | if (nexthdr != IPPROTO_ICMPV6) |
275 | goto discard; | 277 | goto out; |
276 | 278 | ||
277 | if (!pskb_may_pull(skb, (skb_network_header(skb) + | 279 | if (!pskb_may_pull(skb, (skb_network_header(skb) + |
278 | offset + 1 - skb->data))) | 280 | offset + 1 - skb->data))) |
279 | goto discard; | 281 | goto out; |
280 | 282 | ||
281 | icmp6 = (struct icmp6hdr *)(skb_network_header(skb) + offset); | 283 | icmp6 = (struct icmp6hdr *)(skb_network_header(skb) + offset); |
282 | 284 | ||
@@ -285,12 +287,9 @@ int ip6_mc_input(struct sk_buff *skb) | |||
285 | case ICMPV6_MGM_REPORT: | 287 | case ICMPV6_MGM_REPORT: |
286 | case ICMPV6_MGM_REDUCTION: | 288 | case ICMPV6_MGM_REDUCTION: |
287 | case ICMPV6_MLD2_REPORT: | 289 | case ICMPV6_MLD2_REPORT: |
290 | deliver = 1; | ||
288 | break; | 291 | break; |
289 | default: | ||
290 | /* Bogus */ | ||
291 | goto discard; | ||
292 | } | 292 | } |
293 | deliver = 1; | ||
294 | goto out; | 293 | goto out; |
295 | } | 294 | } |
296 | /* unknown RA - process it normally */ | 295 | /* unknown RA - process it normally */ |
@@ -308,15 +307,14 @@ int ip6_mc_input(struct sk_buff *skb) | |||
308 | ip6_mr_input(skb2); | 307 | ip6_mr_input(skb2); |
309 | } | 308 | } |
310 | } | 309 | } |
311 | #endif | ||
312 | out: | 310 | out: |
313 | if (likely(deliver)) { | 311 | #endif |
312 | if (likely(deliver)) | ||
314 | ip6_input(skb); | 313 | ip6_input(skb); |
315 | return 0; | 314 | else { |
315 | /* discard */ | ||
316 | kfree_skb(skb); | ||
316 | } | 317 | } |
317 | discard: | ||
318 | /* discard */ | ||
319 | kfree_skb(skb); | ||
320 | 318 | ||
321 | return 0; | 319 | return 0; |
322 | } | 320 | } |