ipt_ACCOUNT: (tomj) support for 2.6.22
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Wed, 25 Jul 2007 13:08:41 +0000 (13:08 +0000)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Wed, 25 Jul 2007 13:08:41 +0000 (13:08 +0000)
linux-2.6/net/ipv4/netfilter/ipt_ACCOUNT.c

index 61c0af4..5a5f03f 100644 (file)
@@ -453,9 +453,15 @@ static unsigned int ipt_acc_target(struct sk_buff **pskb,
 {
     const struct ipt_acc_info *info = 
         (const struct ipt_acc_info *)targinfo;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
+    u_int32_t src_ip = ip_hdr(*pskb)->saddr;
+    u_int32_t dst_ip = ip_hdr(*pskb)->daddr;
+    u_int32_t size = ntohs(ip_hdr(*pskb)->tot_len);
+#else
     u_int32_t src_ip = (*pskb)->nh.iph->saddr;
     u_int32_t dst_ip = (*pskb)->nh.iph->daddr;
     u_int32_t size = ntohs((*pskb)->nh.iph->tot_len);
+#endif
 
     spin_lock_bh(&ipt_acc_lock);