我用netfilter hooks
.
似乎skb_transport_header
函数计算不正确(有时但并非总是如此):
struct tcphdr* tcp_header = NULL;
tcp_header = (struct tcphdr*)skb_transport_header(skb); // somtimes incorrect address.
tcp_header = (struct tcphdr*)((char*)ip_header + (ip_header->ihl * 4));// always correct address.
我哪里错了?