Re: Extracting info from frag packet in pre route hook

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

 



On Thursday 2012-01-05 06:31, vivek rajagopalan wrote:

>Hi,
>
>I wrote an LKM and I am trying to get UDP port information from the
>first fragmented packet received in PRE_ROUTING hook as follows
>
>struct iphdr *iph = (struct iphdr*) skb_network_header(skb);

You want: struct iphdr *iph = ip_hdr(skb);

>struct udphdr *udph = (struct udphdr *)(iph + (iph->ihl)*4); //or
>(struct udphdr *)(skb->data + (iph->ihl)*4) and other such methods

You need

  struct udphdr *udph = skb_header_pointer(...)

--
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