]> git.neil.brown.name Git - history.git/commitdiff
[IPV6]: Do not use skb_linearize() in ICMP/NDISC handling.
authorDavid S. Miller <davem@nuts.ninka.net>
Thu, 19 Jun 2003 12:42:23 +0000 (05:42 -0700)
committerDavid S. Miller <davem@nuts.ninka.net>
Thu, 19 Jun 2003 12:42:23 +0000 (05:42 -0700)
net/ipv6/icmp.c
net/ipv6/ndisc.c

index 9700faf3e8b3311718c9ae3a7d615e058fb53d33..5cfc70535e350f1bad78d489f5ae7d569eb3365c 100644 (file)
@@ -613,12 +613,6 @@ static int icmpv6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
        case NDISC_NEIGHBOUR_SOLICITATION:
        case NDISC_NEIGHBOUR_ADVERTISEMENT:
        case NDISC_REDIRECT:
-               if (skb_is_nonlinear(skb) &&
-                   skb_linearize(skb, GFP_ATOMIC) != 0) {
-                       kfree_skb(skb);
-                       return 0;
-               }
-
                ndisc_rcv(skb);
                break;
 
index aab59050a6c545dc6b382f73c9432973771901d4..1c582945bac7e01adce4f221dceaef518e2ff357 100644 (file)
@@ -714,12 +714,6 @@ void ndisc_recv_ns(struct sk_buff *skb)
        struct inet6_ifaddr *ifp;
        struct neighbour *neigh;
 
-       if (skb->len < sizeof(struct nd_msg)) {
-               if (net_ratelimit())
-                       printk(KERN_WARNING "ICMP NS: packet too short\n");
-               return;
-       }
-
        if (ipv6_addr_type(&msg->target)&IPV6_ADDR_MULTICAST) {
                if (net_ratelimit())
                        printk(KERN_WARNING "ICMP NS: target address is multicast\n");
@@ -1410,7 +1404,12 @@ static void pndisc_redo(struct sk_buff *skb)
 
 int ndisc_rcv(struct sk_buff *skb)
 {
-       struct nd_msg *msg = (struct nd_msg *) skb->h.raw;
+       struct nd_msg *msg;
+
+       if (!pskb_may_pull(skb, skb->len))
+               return 0;
+
+       msg = (struct nd_msg *) skb->h.raw;
 
        __skb_push(skb, skb->data-skb->h.raw);