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:
Jan Engelhardt
2009-08-13 00:42:01 +02:00
parent 579484ed70
commit 1e5315d338

View File

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