]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/netfilter/xt_TCPMSS.c
Merge branch 'master' of /repos/git/net-next-2.6
[net-next-2.6.git] / net / netfilter / xt_TCPMSS.c
index c5f4b9919e9a016ef3f3428440e2446571293920..d04606459c9de093f4fbced5ef4801a6e8e0cb88 100644 (file)
@@ -7,7 +7,7 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 #include <linux/module.h>
 #include <linux/skbuff.h>
 #include <linux/ip.h>
@@ -68,15 +68,14 @@ tcpmss_mangle_packet(struct sk_buff *skb,
        if (info->mss == XT_TCPMSS_CLAMP_PMTU) {
                if (dst_mtu(skb_dst(skb)) <= minlen) {
                        if (net_ratelimit())
-                               printk(KERN_ERR "xt_TCPMSS: "
-                                      "unknown or invalid path-MTU (%u)\n",
+                               pr_err("unknown or invalid path-MTU (%u)\n",
                                       dst_mtu(skb_dst(skb)));
                        return -1;
                }
                if (in_mtu <= minlen) {
                        if (net_ratelimit())
-                               printk(KERN_ERR "xt_TCPMSS: unknown or "
-                                      "invalid path-MTU (%u)\n", in_mtu);
+                               pr_err("unknown or invalid path-MTU (%u)\n",
+                                      in_mtu);
                        return -1;
                }
                newmss = min(dst_mtu(skb_dst(skb)), in_mtu) - minlen;
@@ -236,7 +235,7 @@ static inline bool find_syn_match(const struct xt_entry_match *m)
        return false;
 }
 
-static bool tcpmss_tg4_check(const struct xt_tgchk_param *par)
+static int tcpmss_tg4_check(const struct xt_tgchk_param *par)
 {
        const struct xt_tcpmss_info *info = par->targinfo;
        const struct ipt_entry *e = par->entryinfo;
@@ -246,19 +245,19 @@ static bool tcpmss_tg4_check(const struct xt_tgchk_param *par)
            (par->hook_mask & ~((1 << NF_INET_FORWARD) |
                           (1 << NF_INET_LOCAL_OUT) |
                           (1 << NF_INET_POST_ROUTING))) != 0) {
-               printk("xt_TCPMSS: path-MTU clamping only supported in "
-                      "FORWARD, OUTPUT and POSTROUTING hooks\n");
-               return false;
+               pr_info("path-MTU clamping only supported in "
+                       "FORWARD, OUTPUT and POSTROUTING hooks\n");
+               return -EINVAL;
        }
        xt_ematch_foreach(ematch, e)
                if (find_syn_match(ematch))
-                       return true;
-       printk("xt_TCPMSS: Only works on TCP SYN packets\n");
-       return false;
+                       return 0;
+       pr_info("Only works on TCP SYN packets\n");
+       return -EINVAL;
 }
 
 #if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE)
-static bool tcpmss_tg6_check(const struct xt_tgchk_param *par)
+static int tcpmss_tg6_check(const struct xt_tgchk_param *par)
 {
        const struct xt_tcpmss_info *info = par->targinfo;
        const struct ip6t_entry *e = par->entryinfo;
@@ -268,15 +267,15 @@ static bool tcpmss_tg6_check(const struct xt_tgchk_param *par)
            (par->hook_mask & ~((1 << NF_INET_FORWARD) |
                           (1 << NF_INET_LOCAL_OUT) |
                           (1 << NF_INET_POST_ROUTING))) != 0) {
-               printk("xt_TCPMSS: path-MTU clamping only supported in "
-                      "FORWARD, OUTPUT and POSTROUTING hooks\n");
-               return false;
+               pr_info("path-MTU clamping only supported in "
+                       "FORWARD, OUTPUT and POSTROUTING hooks\n");
+               return -EINVAL;
        }
        xt_ematch_foreach(ematch, e)
                if (find_syn_match(ematch))
-                       return true;
-       printk("xt_TCPMSS: Only works on TCP SYN packets\n");
-       return false;
+                       return 0;
+       pr_info("Only works on TCP SYN packets\n");
+       return -EINVAL;
 }
 #endif