[NETFILTER]: x_tables: switch hotdrop to bool
[powerpc.git] / net / ipv4 / netfilter / ipt_ttl.c
index 1eca9f4..e7316b2 100644 (file)
@@ -1,6 +1,4 @@
 /* IP tables module for matching the value of the TTL
- *
- * ipt_ttl.c,v 1.5 2000/11/13 11:16:08 laforge Exp
  *
  * (C) 2000,2001 by Harald Welte <laforge@netfilter.org>
  *
@@ -23,22 +21,23 @@ MODULE_LICENSE("GPL");
 static int match(const struct sk_buff *skb,
                 const struct net_device *in, const struct net_device *out,
                 const struct xt_match *match, const void *matchinfo,
-                int offset, unsigned int protoff, int *hotdrop)
+                int offset, unsigned int protoff, bool *hotdrop)
 {
        const struct ipt_ttl_info *info = matchinfo;
+       const u8 ttl = ip_hdr(skb)->ttl;
 
        switch (info->mode) {
                case IPT_TTL_EQ:
-                       return (skb->nh.iph->ttl == info->ttl);
+                       return (ttl == info->ttl);
                        break;
                case IPT_TTL_NE:
-                       return (!(skb->nh.iph->ttl == info->ttl));
+                       return (!(ttl == info->ttl));
                        break;
                case IPT_TTL_LT:
-                       return (skb->nh.iph->ttl < info->ttl);
+                       return (ttl < info->ttl);
                        break;
                case IPT_TTL_GT:
-                       return (skb->nh.iph->ttl > info->ttl);
+                       return (ttl > info->ttl);
                        break;
                default:
                        printk(KERN_WARNING "ipt_ttl: unknown mode %d\n",