skb_copy_expand with a single pointer

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

 



Hello,

My teammate and I are working on a master's project involving netfilter. Using Ubuntu 7.10 (kernel 2.6.22) we were able to successfully take a packet and perform a skb_copy_expand in order to enlarge its size and send it out with additional information. This was when netfilter still used double pointers passed into its hook functions. Simplified code is shown below:

sb = *skb;

if(skb_tailroom(sb) < our_length){
new = skb_copy_expand(sb, skb_headroom(sb), skb_tailroom(sb) +our_length, GFP_ATOMIC)
	if(sb->sk)
		skb_set_owner_w(new, sb->sk);
	if(new)
	{
		*skb = new;
		sb = *skb;
	}
	else
	{
		printk(KERN_INFO "FAIL\n");
	}
}

Now we are trying to port the code to Ubuntu 8.04 (kernel 2.6.24) but netfilter has now moved to using only single pointers passed into its hook functions. We tried the following code, but it doesn't work:

sb = skb;

if(skb_tailroom(sb) < our_length){
new = skb_copy_expand(sb, skb_headroom(sb), skb_tailroom(sb) +our_length, GFP_ATOMIC)
	if(sb->sk)
		skb_set_owner_w(new, sb->sk);
	if(new)
	{
		skb = new;
		sb = skb;
	}
	else
	{
		printk(KERN_INFO "FAIL\n");
	}
}


Can anyone shed any light on how to make this work for the updated kernel?

Thanks,

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

[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux