- Update to 2.6.25-rc3.
[linux-flexiantxendom0-3.2.10.git] / net / ipv4 / netfilter / ipt_TTL.c
index c620a05..30eed65 100644 (file)
 #include <linux/netfilter_ipv4/ipt_TTL.h>
 
 MODULE_AUTHOR("Harald Welte <laforge@netfilter.org>");
-MODULE_DESCRIPTION("IP tables TTL modification module");
+MODULE_DESCRIPTION("Xtables: IPv4 TTL field modification target");
 MODULE_LICENSE("GPL");
 
 static unsigned int
-ipt_ttl_target(struct sk_buff *skb,
-              const struct net_device *in, const struct net_device *out,
-              unsigned int hooknum, const struct xt_target *target,
-              const void *targinfo)
+ttl_tg(struct sk_buff *skb, const struct net_device *in,
+       const struct net_device *out, unsigned int hooknum,
+       const struct xt_target *target, const void *targinfo)
 {
        struct iphdr *iph;
        const struct ipt_TTL_info *info = targinfo;
@@ -54,19 +53,18 @@ ipt_ttl_target(struct sk_buff *skb,
        }
 
        if (new_ttl != iph->ttl) {
-               nf_csum_replace2(&iph->check, htons(iph->ttl << 8),
-                                             htons(new_ttl << 8));
+               csum_replace2(&iph->check, htons(iph->ttl << 8),
+                                          htons(new_ttl << 8));
                iph->ttl = new_ttl;
        }
 
        return XT_CONTINUE;
 }
 
-static bool ipt_ttl_checkentry(const char *tablename,
-               const void *e,
-               const struct xt_target *target,
-               void *targinfo,
-               unsigned int hook_mask)
+static bool
+ttl_tg_check(const char *tablename, const void *e,
+             const struct xt_target *target, void *targinfo,
+             unsigned int hook_mask)
 {
        const struct ipt_TTL_info *info = targinfo;
 
@@ -80,25 +78,25 @@ static bool ipt_ttl_checkentry(const char *tablename,
        return true;
 }
 
-static struct xt_target ipt_TTL __read_mostly = {
+static struct xt_target ttl_tg_reg __read_mostly = {
        .name           = "TTL",
        .family         = AF_INET,
-       .target         = ipt_ttl_target,
+       .target         = ttl_tg,
        .targetsize     = sizeof(struct ipt_TTL_info),
        .table          = "mangle",
-       .checkentry     = ipt_ttl_checkentry,
+       .checkentry     = ttl_tg_check,
        .me             = THIS_MODULE,
 };
 
-static int __init ipt_ttl_init(void)
+static int __init ttl_tg_init(void)
 {
-       return xt_register_target(&ipt_TTL);
+       return xt_register_target(&ttl_tg_reg);
 }
 
-static void __exit ipt_ttl_fini(void)
+static void __exit ttl_tg_exit(void)
 {
-       xt_unregister_target(&ipt_TTL);
+       xt_unregister_target(&ttl_tg_reg);
 }
 
-module_init(ipt_ttl_init);
-module_exit(ipt_ttl_fini);
+module_init(ttl_tg_init);
+module_exit(ttl_tg_exit);