On Fri, 2012-12-07 at 23:23 +0100, Johannes Berg wrote: > Oh I should say ... IP is like black magic to me ;-) > > > - if (!pskb_may_pull(skb, sizeof(struct iphdr))) > > + if (!skb_copy_bits(skb, 0, &iph, sizeof(iph))) > > return skb; > > > > - iph = ip_hdr(skb); > > - if (iph->ihl < 5 || iph->version != 4) > > + if (iph.ihl < 5 || iph.version != 4) > > return skb; > > - if (!pskb_may_pull(skb, iph->ihl*4)) > > - return skb; > > - iph = ip_hdr(skb); > > - len = ntohs(iph->tot_len); > > - if (skb->len < len || len < (iph->ihl * 4)) > > + > > + len = ntohs(iph.tot_len); > > + if (skb->len < len || len < (iph.ihl * 4)) > > return skb; > > > > - if (ip_is_fragment(ip_hdr(skb))) { > > + if (ip_is_fragment(&iph)) { > > skb = skb_share_check(skb, GFP_ATOMIC); > > if (skb) { > > + if (!pskb_may_pull(skb, iph.ihl*4)) > > + return skb; > > I moved this here but I have no idea what it does. Well, ok, looking further it does seem kinda obvious -- ip_defrag() assumes the IP header is (fully?) present in the skb header, so that's what this does. Eric (Leblond), could you test this patch? johannes -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html