mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-06 20:55:13 +02:00
psd: replace open-coded access by skb handling functions
pskb->network_header would not even compile under older kernels. This also fixes the compile warning: xt_psd.c:116:18: warning: cast to pointer from integer of different size
This commit is contained in:
@@ -113,7 +113,7 @@ xt_psd_match(const struct sk_buff *pskb, const struct xt_match_param *match)
|
||||
const struct xt_psd_info *psdinfo = match->matchinfo;
|
||||
|
||||
/* IP header */
|
||||
iph = (struct iphdr*) pskb->network_header;
|
||||
iph = ip_hdr(pskb);
|
||||
|
||||
/* Sanity check */
|
||||
if (ntohs(iph->frag_off) & IP_OFFSET) {
|
||||
@@ -133,7 +133,7 @@ xt_psd_match(const struct sk_buff *pskb, const struct xt_match_param *match)
|
||||
|
||||
addr.s_addr = iph->saddr;
|
||||
|
||||
tcph = (struct tcphdr*)((u_int32_t *)iph + iph->ihl);
|
||||
tcph = (void *)iph + ip_hdrlen(pskb);
|
||||
|
||||
/* Yep, it<69>s dirty */
|
||||
src_port = tcph->source;
|
||||
|
Reference in New Issue
Block a user