Extracting info from frag packet in pre route hook

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

 



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);
struct udphdr *udph = (struct udphdr *)(iph + (iph->ihl)*4); //or
(struct udphdr *)(skb->data + (iph->ihl)*4) and other such methods

However ntohs(udph->source) is always returning 0. This method works
for a non-fragmented packet. I am wondering if PRE_ROUTING is a good
place to do this at all or LOCAL_IN is the correct place. Or is it
that i am trying to fetch the payload from the wrong data pointers?

I am using 2.6.35 kernel

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