Amit Dang <dangamit@xxxxxxxxx> wrote: > Hi, wanted to know if udp_hdr/tcp_hdr can be safely used in context of > netfilter hooks to extract udp/tcp data from skb? No. > I am facing some issue with using udp_hdr/tcp_hdr on 2.6.32 kernels. > It doesn't provide the expected information but skb_header_pointer() > seems to work. > > Not seeing this issue with 3.x/4.x kernels. Coincidence, its not guaranteed to work. Use skb_header_pointer().