]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv6/icmp.c
[POWERPC] arch/powerpc/kernel/sysfs.c: Move NUMA exports
[linux-2.6-omap-h63xx.git] / net / ipv6 / icmp.c
index 3a01effda6955ba3bb8b86134dc93c37427e9bcf..e9bcce9e7bdfb8bf59b74cf199fa16ac8c7a960e 100644 (file)
@@ -222,7 +222,7 @@ static int icmpv6_push_pending_frames(struct sock *sk, struct flowi *fl, struct
        if ((skb = skb_peek(&sk->sk_write_queue)) == NULL)
                goto out;
 
-       icmp6h = (struct icmp6hdr*) skb->h.raw;
+       icmp6h = icmp6_hdr(skb);
        memcpy(icmp6h, thdr, sizeof(struct icmp6hdr));
        icmp6h->icmp6_cksum = 0;
 
@@ -317,7 +317,8 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info,
        int hlimit, tclass;
        int err = 0;
 
-       if ((u8*)hdr < skb->head || (u8*)(hdr+1) > skb->tail)
+       if ((u8 *)hdr < skb->head ||
+           (skb->network_header + sizeof(*hdr)) > skb->tail)
                return;
 
        /*
@@ -476,7 +477,7 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
        struct inet6_dev *idev;
        struct ipv6_pinfo *np;
        struct in6_addr *saddr = NULL;
-       struct icmp6hdr *icmph = (struct icmp6hdr *) skb->h.raw;
+       struct icmp6hdr *icmph = icmp6_hdr(skb);
        struct icmp6hdr tmp_hdr;
        struct flowi fl;
        struct icmpv6_msg msg;
@@ -651,7 +652,7 @@ static int icmpv6_rcv(struct sk_buff **pskb)
        if (!pskb_pull(skb, sizeof(struct icmp6hdr)))
                goto discard_it;
 
-       hdr = (struct icmp6hdr *) skb->h.raw;
+       hdr = icmp6_hdr(skb);
 
        type = hdr->icmp6_type;
 
@@ -677,7 +678,7 @@ static int icmpv6_rcv(struct sk_buff **pskb)
                 */
                if (!pskb_may_pull(skb, sizeof(struct ipv6hdr)))
                        goto discard_it;
-               hdr = (struct icmp6hdr *) skb->h.raw;
+               hdr = icmp6_hdr(skb);
                orig_hdr = (struct ipv6hdr *) (hdr + 1);
                rt6_pmtu_discovery(&orig_hdr->daddr, &orig_hdr->saddr, dev,
                                   ntohl(hdr->icmp6_mtu));
@@ -731,7 +732,8 @@ static int icmpv6_rcv(struct sk_buff **pskb)
                 */
 
                icmpv6_notify(skb, type, hdr->icmp6_code, hdr->icmp6_mtu);
-       };
+       }
+
        kfree_skb(skb);
        return 0;
 
@@ -864,7 +866,7 @@ int icmpv6_err_convert(int type, int code, int *err)
        case ICMPV6_TIME_EXCEED:
                *err = EHOSTUNREACH;
                break;
-       };
+       }
 
        return fatal;
 }