Problem with IP defragmentation in 2.6 kernel

Jan Engelhardt jengelh at linux01.gwdg.de
Mon Mar 12 18:30:04 CET 2007


On Mar 12 2007 15:46, Kanhu Rauta wrote:
> So i am doing the assemble in my hook like this....
> if(skb->len > skb->tail-skb->data){
> temp=skb_shinfo(skb)->frag_list;
> while(skb->len > skb->tail-skb->data){
> if(temp==NULL)
> printk("Fragmented Data is NULL\n");
> else if((skb->end-skb->tail)>temp->len){
> strncpy(skb->tail,temp->data,temp->len);
> skb->tail+=temp->len;
> }
> if(temp->next != NULL) temp=temp->next;
> else{ printk("Fragmentation finished\n"); break ;}
> }

Woha. *Blatant* violation of encapsulation (even if C does not
have a notion of encapsulation).

> Doing this i am able to get the complete packet, Is it the right way ?
>                   or
> Is there any other way to get the complete packet in local in hook ?
>
Like I said in my earlier reply, try using skb_header_pointer().


Jan
-- 



More information about the netfilter-devel mailing list