Is my program is correct to print packet data part at IP layer?

Rusty Russell rusty at rustcorp.com.au
Sun Jan 2 00:59:02 CET 2005


On Fri, 2004-12-31 at 04:13 -0800, linux lover wrote:
> Respected sir,
>             I request you to please check my program
> and reply me whether it is the correct way of getting
> packets data part at IP layer? I am using netfilter
> and dumping its output to unsigned string. I just want
> to know the results return by following program is
> correct or wrong?

Hi,

	The data field may not be linear; it will be in pieces for many
packets.  Also, skb->data will point at the IP header, not the data
within the packet.  I recommend looking at ip_conntrack_ftp which has to
look inside TCP packets, for example.

Good luck!
Rusty.
-- 
A bad analogy is like a leaky screwdriver -- Richard Braakman




More information about the netfilter-devel mailing list