]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/ipv4/netfilter/ipt_REJECT.c
Merge branch 'master' of /repos/git/net-next-2.6
[karo-tx-linux.git] / net / ipv4 / netfilter / ipt_REJECT.c
index a0e8bcf041592cac88b9a623cb001e22cd0b55cd..a86135a280588b4d6d98ed47ec4255b1b1fa9e85 100644 (file)
@@ -9,7 +9,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/slab.h>
@@ -140,9 +140,6 @@ reject_tg(struct sk_buff *skb, const struct xt_target_param *par)
 {
        const struct ipt_reject_info *reject = par->targinfo;
 
-       /* WARNING: This code causes reentry within iptables.
-          This means that the iptables jump stack is now crap.  We
-          must return an absolute verdict. --RR */
        switch (reject->with) {
        case IPT_ICMP_NET_UNREACHABLE:
                send_unreach(skb, ICMP_NET_UNREACH);
@@ -175,23 +172,23 @@ reject_tg(struct sk_buff *skb, const struct xt_target_param *par)
        return NF_DROP;
 }
 
-static bool reject_tg_check(const struct xt_tgchk_param *par)
+static int reject_tg_check(const struct xt_tgchk_param *par)
 {
        const struct ipt_reject_info *rejinfo = par->targinfo;
        const struct ipt_entry *e = par->entryinfo;
 
        if (rejinfo->with == IPT_ICMP_ECHOREPLY) {
-               printk("ipt_REJECT: ECHOREPLY no longer supported.\n");
-               return false;
+               pr_info("ECHOREPLY no longer supported.\n");
+               return -EINVAL;
        } else if (rejinfo->with == IPT_TCP_RESET) {
                /* Must specify that it's a TCP packet */
                if (e->ip.proto != IPPROTO_TCP ||
                    (e->ip.invflags & XT_INV_PROTO)) {
-                       printk("ipt_REJECT: TCP_RESET invalid for non-tcp\n");
-                       return false;
+                       pr_info("TCP_RESET invalid for non-tcp\n");
+                       return -EINVAL;
                }
        }
-       return true;
+       return 0;
 }
 
 static struct xt_target reject_tg_reg __read_mostly = {