Extracting port numbers
cs83152 at csie.chu.edu.tw
Thu May 4 07:05:46 CEST 2006
>I was trying to extract tcp port numbers from sk_buff, going
>through netfilter code, there seem multiple ways of doing it.
>I was wondering if there is one standard way to do it which is
>generic enough to fit any situation.
>For seem reason the
>struct tcphrd *tcp = (struct tcphrd *)(skb->data +
>dest_port = tcp->dest;
>does not work and extracts wrong port numbers.
It seems ok. Do you miss to use the ntohs function to conver to the
More information about the netfilter-devel