]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/ipv4/netfilter/ipt_ecn.c
netfilter: xtables: change hotdrop pointer to direct modification
[net-next-2.6.git] / net / ipv4 / netfilter / ipt_ecn.c
index e661108c73f18de89abdd07073fe5f18a55eb72c..af6e9c778345ff802916cc7fa0078cbd79735c81 100644 (file)
@@ -67,7 +67,7 @@ static inline bool match_tcp(const struct sk_buff *skb,
        return true;
 }
 
-static bool ecn_mt(const struct sk_buff *skb, const struct xt_match_param *par)
+static bool ecn_mt(const struct sk_buff *skb, struct xt_action_param *par)
 {
        const struct ipt_ecn_info *info = par->matchinfo;
 
@@ -78,31 +78,31 @@ static bool ecn_mt(const struct sk_buff *skb, const struct xt_match_param *par)
        if (info->operation & (IPT_ECN_OP_MATCH_ECE|IPT_ECN_OP_MATCH_CWR)) {
                if (ip_hdr(skb)->protocol != IPPROTO_TCP)
                        return false;
-               if (!match_tcp(skb, info, par->hotdrop))
+               if (!match_tcp(skb, info, &par->hotdrop))
                        return false;
        }
 
        return true;
 }
 
-static bool ecn_mt_check(const struct xt_mtchk_param *par)
+static int ecn_mt_check(const struct xt_mtchk_param *par)
 {
        const struct ipt_ecn_info *info = par->matchinfo;
        const struct ipt_ip *ip = par->entryinfo;
 
        if (info->operation & IPT_ECN_OP_MATCH_MASK)
-               return false;
+               return -EINVAL;
 
        if (info->invert & IPT_ECN_OP_MATCH_MASK)
-               return false;
+               return -EINVAL;
 
        if (info->operation & (IPT_ECN_OP_MATCH_ECE|IPT_ECN_OP_MATCH_CWR) &&
            ip->proto != IPPROTO_TCP) {
                pr_info("cannot match TCP bits in rule for non-tcp packets\n");
-               return false;
+               return -EINVAL;
        }
 
-       return true;
+       return 0;
 }
 
 static struct xt_match ecn_mt_reg __read_mostly = {