Fwd: Question: ip_frag-reasm function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi,guys.

I had read ip_frag_reasm function,i got a problem and didn't know why
it did that.

If you know it ,please tell me.thanks a lot.



ip_frag_reasm():

"If the first fragment is fragmented itself, we split it to two
chunks: the first with data and paged part and the second, holding
only fragments."

why did we do that?if we didn't split it to two chunks, what result
did we wait for?

static struct sk_buff *ip_frag_reasm(struct ipq *qp, struct net_device *dev)

{

     ...

   /* If the first fragment is fragmented itself, we split

     * it to two chunks: the first with data and paged part

     * and the second, holding only fragments.

     */

   if (skb_shinfo(head)->frag_list) {

        struct sk_buff *clone;

        int i, plen = 0;



        if ((clone = alloc_skb(0, GFP_ATOMIC)) == NULL)

            goto out_nomem;

        clone->next = head->next;

        head->next = clone;

        /* clone指向frag_list */

        skb_shinfo(clone)->frag_list = skb_shinfo(head)->frag_list;

        skb_shinfo(head)->frag_list = NULL;

        for (i=0; i<skb_shinfo(head)->nr_frags; i++)

            plen += skb_shinfo(head)->frags[i].size;

        clone->len = clone->data_len = head->data_len - plen;

        head->data_len -= clone->len;

        head->len -= clone->len;

        clone->csum = 0;

        clone->ip_summed = head->ip_summed;

        atomic_add(clone->truesize, &ip_frag_mem);

    }

    ...

}


--
To be a better man
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux