netfilter: xtables: change targets to return error code
[deliverable/linux.git] / net / netfilter / xt_CT.c
index 61c50fa8470374c9b76580e3dfbee045ee090837..ee566e2e4534e7577c640eb6b458273353242ad2 100644 (file)
@@ -37,13 +37,13 @@ static unsigned int xt_ct_target(struct sk_buff *skb,
 
 static u8 xt_ct_find_proto(const struct xt_tgchk_param *par)
 {
-       if (par->family == AF_INET) {
+       if (par->family == NFPROTO_IPV4) {
                const struct ipt_entry *e = par->entryinfo;
 
                if (e->ip.invflags & IPT_INV_PROTO)
                        return 0;
                return e->ip.proto;
-       } else if (par->family == AF_INET6) {
+       } else if (par->family == NFPROTO_IPV6) {
                const struct ip6t_entry *e = par->entryinfo;
 
                if (e->ipv6.invflags & IP6T_INV_PROTO)
@@ -53,7 +53,7 @@ static u8 xt_ct_find_proto(const struct xt_tgchk_param *par)
                return 0;
 }
 
-static bool xt_ct_tg_check(const struct xt_tgchk_param *par)
+static int xt_ct_tg_check(const struct xt_tgchk_param *par)
 {
        struct xt_ct_target_info *info = par->targinfo;
        struct nf_conntrack_tuple t;
@@ -62,7 +62,7 @@ static bool xt_ct_tg_check(const struct xt_tgchk_param *par)
        u8 proto;
 
        if (info->flags & ~XT_CT_NOTRACK)
-               return false;
+               return -EINVAL;
 
        if (info->flags & XT_CT_NOTRACK) {
                ct = &nf_conntrack_untracked;
@@ -108,14 +108,14 @@ static bool xt_ct_tg_check(const struct xt_tgchk_param *par)
        __set_bit(IPS_CONFIRMED_BIT, &ct->status);
 out:
        info->ct = ct;
-       return true;
+       return 0;
 
 err3:
        nf_conntrack_free(ct);
 err2:
        nf_ct_l3proto_module_put(par->family);
 err1:
-       return false;
+       return -EINVAL;
 }
 
 static void xt_ct_tg_destroy(const struct xt_tgdtor_param *par)
@@ -137,7 +137,7 @@ static void xt_ct_tg_destroy(const struct xt_tgdtor_param *par)
 static struct xt_target xt_ct_tg __read_mostly = {
        .name           = "CT",
        .family         = NFPROTO_UNSPEC,
-       .targetsize     = XT_ALIGN(sizeof(struct xt_ct_target_info)),
+       .targetsize     = sizeof(struct xt_ct_target_info),
        .checkentry     = xt_ct_tg_check,
        .destroy        = xt_ct_tg_destroy,
        .target         = xt_ct_target,
This page took 0.107497 seconds and 5 git commands to generate.