]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
netfilter: xtables: change xt_target.checkentry return type
authorJan Engelhardt <jengelh@medozas.de>
Fri, 19 Mar 2010 16:16:42 +0000 (17:16 +0100)
committerJan Engelhardt <jengelh@medozas.de>
Thu, 25 Mar 2010 15:04:33 +0000 (16:04 +0100)
Restore function signatures from bool to int so that we can report
memory allocation failures or similar using -ENOMEM rather than
always having to pass -EINVAL back.

// <smpl>
@@
type bool;
identifier check, par;
@@
-bool check
+int check
 (struct xt_tgchk_param *par) { ... }
// </smpl>

Minus the change it does to xt_ct_find_proto.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
33 files changed:
include/linux/netfilter/x_tables.h
net/bridge/netfilter/ebt_arpreply.c
net/bridge/netfilter/ebt_dnat.c
net/bridge/netfilter/ebt_log.c
net/bridge/netfilter/ebt_mark.c
net/bridge/netfilter/ebt_nflog.c
net/bridge/netfilter/ebt_redirect.c
net/bridge/netfilter/ebt_snat.c
net/bridge/netfilter/ebt_ulog.c
net/ipv4/netfilter/arpt_mangle.c
net/ipv4/netfilter/ipt_CLUSTERIP.c
net/ipv4/netfilter/ipt_ECN.c
net/ipv4/netfilter/ipt_LOG.c
net/ipv4/netfilter/ipt_MASQUERADE.c
net/ipv4/netfilter/ipt_NETMAP.c
net/ipv4/netfilter/ipt_REDIRECT.c
net/ipv4/netfilter/ipt_REJECT.c
net/ipv4/netfilter/ipt_ULOG.c
net/ipv4/netfilter/nf_nat_rule.c
net/ipv6/netfilter/ip6t_LOG.c
net/ipv6/netfilter/ip6t_REJECT.c
net/netfilter/xt_CONNSECMARK.c
net/netfilter/xt_CT.c
net/netfilter/xt_DSCP.c
net/netfilter/xt_HL.c
net/netfilter/xt_LED.c
net/netfilter/xt_NFLOG.c
net/netfilter/xt_NFQUEUE.c
net/netfilter/xt_RATEEST.c
net/netfilter/xt_SECMARK.c
net/netfilter/xt_TCPMSS.c
net/netfilter/xt_TPROXY.c
net/netfilter/xt_connmark.c

index 33c1a62a0997f7c89674039272c930ac8189c4f0..1a65d45ee4f5f8d1df989e83c4356b5010ab709c 100644 (file)
@@ -342,8 +342,8 @@ struct xt_target {
        /* Called when user tries to insert an entry of this type:
            hook_mask is a bitmask of hooks from which it can be
            called. */
-       /* Should return true or false. */
-       bool (*checkentry)(const struct xt_tgchk_param *);
+       /* Should return true or false, or an error code (-Exxxx). */
+       int (*checkentry)(const struct xt_tgchk_param *);
 
        /* Called when entry of this type deleted. */
        void (*destroy)(const struct xt_tgdtor_param *);
index f392e9d93f53404d50628494fdec57d573e17fba..2491564e9e083f8df896269a05a1c2bd93a1d6ba 100644 (file)
@@ -57,7 +57,7 @@ ebt_arpreply_tg(struct sk_buff *skb, const struct xt_target_param *par)
        return info->target;
 }
 
-static bool ebt_arpreply_tg_check(const struct xt_tgchk_param *par)
+static int ebt_arpreply_tg_check(const struct xt_tgchk_param *par)
 {
        const struct ebt_arpreply_info *info = par->targinfo;
        const struct ebt_entry *e = par->entryinfo;
index 2bb40d728a35ae37b0ab875b33c9dfd3f490c14b..5fddebea45c299cd80a571780590888d287fbacc 100644 (file)
@@ -26,7 +26,7 @@ ebt_dnat_tg(struct sk_buff *skb, const struct xt_target_param *par)
        return info->target;
 }
 
-static bool ebt_dnat_tg_check(const struct xt_tgchk_param *par)
+static int ebt_dnat_tg_check(const struct xt_tgchk_param *par)
 {
        const struct ebt_nat_info *info = par->targinfo;
        unsigned int hook_mask;
index e873924ddb5db959efdc791eedd0c41fcbef6338..a0aeac6176ee743b2af50ebbdd07d8b4bbb0466d 100644 (file)
@@ -24,7 +24,7 @@
 
 static DEFINE_SPINLOCK(ebt_log_lock);
 
-static bool ebt_log_tg_check(const struct xt_tgchk_param *par)
+static int ebt_log_tg_check(const struct xt_tgchk_param *par)
 {
        struct ebt_log_info *info = par->targinfo;
 
index 2b5ce533d6b93c77b2bf7c5906cb29e70415df7a..dd94dafa6155cb1499581c1473e1c9c76ac30c57 100644 (file)
@@ -36,7 +36,7 @@ ebt_mark_tg(struct sk_buff *skb, const struct xt_target_param *par)
        return info->target | ~EBT_VERDICT_BITS;
 }
 
-static bool ebt_mark_tg_check(const struct xt_tgchk_param *par)
+static int ebt_mark_tg_check(const struct xt_tgchk_param *par)
 {
        const struct ebt_mark_t_info *info = par->targinfo;
        int tmp;
index 40dbd248b9ae284fb3b13e6b36455c6b8aa6fef9..1f2b7bbdde73423c98567423e2935bcdbbbf5bd3 100644 (file)
@@ -35,7 +35,7 @@ ebt_nflog_tg(struct sk_buff *skb, const struct xt_target_param *par)
        return EBT_CONTINUE;
 }
 
-static bool ebt_nflog_tg_check(const struct xt_tgchk_param *par)
+static int ebt_nflog_tg_check(const struct xt_tgchk_param *par)
 {
        struct ebt_nflog_info *info = par->targinfo;
 
index 9be8fbcd370b93eb33137c8e4e2c2f08b432f919..73c4d3ac6f2ef08483a909b18dea773682328a3a 100644 (file)
@@ -32,7 +32,7 @@ ebt_redirect_tg(struct sk_buff *skb, const struct xt_target_param *par)
        return info->target;
 }
 
-static bool ebt_redirect_tg_check(const struct xt_tgchk_param *par)
+static int ebt_redirect_tg_check(const struct xt_tgchk_param *par)
 {
        const struct ebt_redirect_info *info = par->targinfo;
        unsigned int hook_mask;
index 9c7b520765a2de7c629ee7abe2f9c78fe8f1c69f..94bcecd90d7485313147b6832add7e9a58272708 100644 (file)
@@ -42,7 +42,7 @@ out:
        return info->target | ~EBT_VERDICT_BITS;
 }
 
-static bool ebt_snat_tg_check(const struct xt_tgchk_param *par)
+static int ebt_snat_tg_check(const struct xt_tgchk_param *par)
 {
        const struct ebt_nat_info *info = par->targinfo;
        int tmp;
index 789ea36f1db13c100c035eee12b5e10f1b123b47..f554bc2515d67d071236f085ad520c665c62336f 100644 (file)
@@ -249,7 +249,7 @@ ebt_ulog_tg(struct sk_buff *skb, const struct xt_target_param *par)
        return EBT_CONTINUE;
 }
 
-static bool ebt_ulog_tg_check(const struct xt_tgchk_param *par)
+static int ebt_ulog_tg_check(const struct xt_tgchk_param *par)
 {
        struct ebt_ulog_info *uloginfo = par->targinfo;
 
index b0d5b1d0a7693726cf07bf521c559f0e45c20c5b..4b51a027f307234e71565a039e780ff75d6e72de 100644 (file)
@@ -54,7 +54,7 @@ target(struct sk_buff *skb, const struct xt_target_param *par)
        return mangle->target;
 }
 
-static bool checkentry(const struct xt_tgchk_param *par)
+static int checkentry(const struct xt_tgchk_param *par)
 {
        const struct arpt_mangle *mangle = par->targinfo;
 
index fcaa0dc8e0757b1102fc2a595134e19c6cd8be74..290a7b9b393e3cb7140aab50a83b4d96fa7dca12 100644 (file)
@@ -347,7 +347,7 @@ clusterip_tg(struct sk_buff *skb, const struct xt_target_param *par)
        return XT_CONTINUE;
 }
 
-static bool clusterip_tg_check(const struct xt_tgchk_param *par)
+static int clusterip_tg_check(const struct xt_tgchk_param *par)
 {
        struct ipt_clusterip_tgt_info *cipinfo = par->targinfo;
        const struct ipt_entry *e = par->entryinfo;
index 01988752547e3eaf796a481071e33c6f8a06e120..9d96500a41573d1dc60956f0934f772f463c28ab 100644 (file)
@@ -93,7 +93,7 @@ ecn_tg(struct sk_buff *skb, const struct xt_target_param *par)
        return XT_CONTINUE;
 }
 
-static bool ecn_tg_check(const struct xt_tgchk_param *par)
+static int ecn_tg_check(const struct xt_tgchk_param *par)
 {
        const struct ipt_ECN_info *einfo = par->targinfo;
        const struct ipt_entry *e = par->entryinfo;
index b3bf623fa22245fa0c8f924659ab25dd630dc688..c9ee5c40d1bbb769a6272c752f09feeb0717100b 100644 (file)
@@ -439,7 +439,7 @@ log_tg(struct sk_buff *skb, const struct xt_target_param *par)
        return XT_CONTINUE;
 }
 
-static bool log_tg_check(const struct xt_tgchk_param *par)
+static int log_tg_check(const struct xt_tgchk_param *par)
 {
        const struct ipt_log_info *loginfo = par->targinfo;
 
index 5063ddac7c046e8d71b4de492321d2c90e526b21..5a182f6de5d505704028aa535a7b48f4c8897515 100644 (file)
@@ -28,7 +28,7 @@ MODULE_AUTHOR("Netfilter Core Team <coreteam@netfilter.org>");
 MODULE_DESCRIPTION("Xtables: automatic-address SNAT");
 
 /* FIXME: Multiple targets. --RR */
-static bool masquerade_tg_check(const struct xt_tgchk_param *par)
+static int masquerade_tg_check(const struct xt_tgchk_param *par)
 {
        const struct nf_nat_multi_range_compat *mr = par->targinfo;
 
index 51ab01a0a95d45222058638dd3e3330e87161305..cbfe5f7e082ae88d3cab217c862cd8ad02821038 100644 (file)
@@ -22,7 +22,7 @@ MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Svenning Soerensen <svenning@post5.tele.dk>");
 MODULE_DESCRIPTION("Xtables: 1:1 NAT mapping of IPv4 subnets");
 
-static bool netmap_tg_check(const struct xt_tgchk_param *par)
+static int netmap_tg_check(const struct xt_tgchk_param *par)
 {
        const struct nf_nat_multi_range_compat *mr = par->targinfo;
 
index 74f1f55fd61a78f0346b9cfb4ce56c5093502a40..f8daec20fb046698ba2ba22e19da0ac4a6a49b20 100644 (file)
@@ -26,7 +26,7 @@ MODULE_AUTHOR("Netfilter Core Team <coreteam@netfilter.org>");
 MODULE_DESCRIPTION("Xtables: Connection redirection to localhost");
 
 /* FIXME: Take multiple ranges --RR */
-static bool redirect_tg_check(const struct xt_tgchk_param *par)
+static int redirect_tg_check(const struct xt_tgchk_param *par)
 {
        const struct nf_nat_multi_range_compat *mr = par->targinfo;
 
index ff32252bad591c5b8076fe86961e72393a3d7ae5..cf76f1bc3f106f63a6b45eeb8b19d3114629c3d4 100644 (file)
@@ -174,7 +174,7 @@ 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;
index d926201560dd7cb40b70993532339d38148710ff..7f73bbe2193c9b397f52ca0ba8cb276569f8a867 100644 (file)
@@ -307,7 +307,7 @@ static void ipt_logfn(u_int8_t pf,
        ipt_ulog_packet(hooknum, skb, in, out, &loginfo, prefix);
 }
 
-static bool ulog_tg_check(const struct xt_tgchk_param *par)
+static int ulog_tg_check(const struct xt_tgchk_param *par)
 {
        const struct ipt_ulog_info *loginfo = par->targinfo;
 
index 7d6345e416c75c7df8ac3918ba1c87f0e288e027..117226708738285c2708c913d757e1023655e5c8 100644 (file)
@@ -74,7 +74,7 @@ ipt_dnat_target(struct sk_buff *skb, const struct xt_target_param *par)
        return nf_nat_setup_info(ct, &mr->range[0], IP_NAT_MANIP_DST);
 }
 
-static bool ipt_snat_checkentry(const struct xt_tgchk_param *par)
+static int ipt_snat_checkentry(const struct xt_tgchk_param *par)
 {
        const struct nf_nat_multi_range_compat *mr = par->targinfo;
 
@@ -86,7 +86,7 @@ static bool ipt_snat_checkentry(const struct xt_tgchk_param *par)
        return true;
 }
 
-static bool ipt_dnat_checkentry(const struct xt_tgchk_param *par)
+static int ipt_dnat_checkentry(const struct xt_tgchk_param *par)
 {
        const struct nf_nat_multi_range_compat *mr = par->targinfo;
 
index 5a79883220e042af2ca299acc759de1757c39e6a..bcc3fc19374a593ff116e91cd8946a4fd72873d0 100644 (file)
@@ -451,7 +451,7 @@ log_tg6(struct sk_buff *skb, const struct xt_target_param *par)
 }
 
 
-static bool log_tg6_check(const struct xt_tgchk_param *par)
+static int log_tg6_check(const struct xt_tgchk_param *par)
 {
        const struct ip6t_log_info *loginfo = par->targinfo;
 
index 45efb9f38fcb1565062d29a1963014030665af54..8d5141ece67140b20ac667511884f27de9b75d98 100644 (file)
@@ -213,7 +213,7 @@ reject_tg6(struct sk_buff *skb, const struct xt_target_param *par)
        return NF_DROP;
 }
 
-static bool reject_tg6_check(const struct xt_tgchk_param *par)
+static int reject_tg6_check(const struct xt_tgchk_param *par)
 {
        const struct ip6t_reject_info *rejinfo = par->targinfo;
        const struct ip6t_entry *e = par->entryinfo;
index 6812865488d6ed4d87b836274ec5dfe94d9906ca..3f9d0f4f852dd784e8e57110af3f474a0d34e316 100644 (file)
@@ -84,7 +84,7 @@ connsecmark_tg(struct sk_buff *skb, const struct xt_target_param *par)
        return XT_CONTINUE;
 }
 
-static bool connsecmark_tg_check(const struct xt_tgchk_param *par)
+static int connsecmark_tg_check(const struct xt_tgchk_param *par)
 {
        const struct xt_connsecmark_target_info *info = par->targinfo;
 
index 6509e03f1e6233f7c288c20d9922cd5033ea08e9..c1553bf06cf68aa9eece28488397b76ee4f2c2b7 100644 (file)
@@ -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;
index bbf08a91c600045490f03c9e5c214cc3138f4498..1fa7b67bf2258a942f545fbb635b24bca073e1df 100644 (file)
@@ -60,7 +60,7 @@ dscp_tg6(struct sk_buff *skb, const struct xt_target_param *par)
        return XT_CONTINUE;
 }
 
-static bool dscp_tg_check(const struct xt_tgchk_param *par)
+static int dscp_tg_check(const struct xt_tgchk_param *par)
 {
        const struct xt_DSCP_info *info = par->targinfo;
 
index 7004ed2ffa44cb10f39c3817e2ab7061c3c910e9..15ba1610818253fc399e0b7b0afcb9ebb5b3e864 100644 (file)
@@ -101,7 +101,7 @@ hl_tg6(struct sk_buff *skb, const struct xt_target_param *par)
        return XT_CONTINUE;
 }
 
-static bool ttl_tg_check(const struct xt_tgchk_param *par)
+static int ttl_tg_check(const struct xt_tgchk_param *par)
 {
        const struct ipt_TTL_info *info = par->targinfo;
 
@@ -114,7 +114,7 @@ static bool ttl_tg_check(const struct xt_tgchk_param *par)
        return true;
 }
 
-static bool hl_tg6_check(const struct xt_tgchk_param *par)
+static int hl_tg6_check(const struct xt_tgchk_param *par)
 {
        const struct ip6t_HL_info *info = par->targinfo;
 
index f511bea9464a2f2b1e5a094906cae38111017599..1a3e3dd5a774629941fb4c225b41aed3ccac033f 100644 (file)
@@ -80,7 +80,7 @@ static void led_timeout_callback(unsigned long data)
        led_trigger_event(&ledinternal->netfilter_led_trigger, LED_OFF);
 }
 
-static bool led_tg_check(const struct xt_tgchk_param *par)
+static int led_tg_check(const struct xt_tgchk_param *par)
 {
        struct xt_led_info *ledinfo = par->targinfo;
        struct xt_led_info_internal *ledinternal;
index a57c5cf018ec04871d07a4f4c948c78b08ddb443..13e6c0002c8a26a76b20518eb503fe5a9f8b3a3f 100644 (file)
@@ -37,7 +37,7 @@ nflog_tg(struct sk_buff *skb, const struct xt_target_param *par)
        return XT_CONTINUE;
 }
 
-static bool nflog_tg_check(const struct xt_tgchk_param *par)
+static int nflog_tg_check(const struct xt_tgchk_param *par)
 {
        const struct xt_nflog_info *info = par->targinfo;
 
index 7cc0de63aa0f141d302800748a017abc7f3547a0..d435579a64cad0f69ad0bb5833c15e367eb4b718 100644 (file)
@@ -81,7 +81,7 @@ nfqueue_tg_v1(struct sk_buff *skb, const struct xt_target_param *par)
        return NF_QUEUE_NR(queue);
 }
 
-static bool nfqueue_tg_v1_check(const struct xt_tgchk_param *par)
+static int nfqueue_tg_v1_check(const struct xt_tgchk_param *par)
 {
        const struct xt_NFQ_info_v1 *info = par->targinfo;
        u32 maxid;
index 87ae97e5516f91413c7ca7decdffc976263787b1..9743e50be8ef78e895baf747dc3d789c82c5fa89 100644 (file)
@@ -85,7 +85,7 @@ xt_rateest_tg(struct sk_buff *skb, const struct xt_target_param *par)
        return XT_CONTINUE;
 }
 
-static bool xt_rateest_tg_checkentry(const struct xt_tgchk_param *par)
+static int xt_rateest_tg_checkentry(const struct xt_tgchk_param *par)
 {
        struct xt_rateest_target_info *info = par->targinfo;
        struct xt_rateest *est;
index 4855fd9d7c6f787390a1f195b7b8daa0b6b7a22a..48f8e4f7ea8a76dbc18b08736179340317db3a74 100644 (file)
@@ -80,7 +80,7 @@ static bool checkentry_selinux(struct xt_secmark_target_info *info)
        return true;
 }
 
-static bool secmark_tg_check(const struct xt_tgchk_param *par)
+static int secmark_tg_check(const struct xt_tgchk_param *par)
 {
        struct xt_secmark_target_info *info = par->targinfo;
 
index 45161d9a9f239bb6b278dba733b5a89780a417ea..70288dc31583b309926aaba71c5a523295b395b8 100644 (file)
@@ -234,7 +234,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;
@@ -256,7 +256,7 @@ static bool tcpmss_tg4_check(const struct xt_tgchk_param *par)
 }
 
 #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;
index e9244fdc123a209bc857345f66ce07088167d7eb..189df9af4de6e4a40a04878dabc39e833143ec9c 100644 (file)
@@ -59,7 +59,7 @@ tproxy_tg(struct sk_buff *skb, const struct xt_target_param *par)
        return NF_DROP;
 }
 
-static bool tproxy_tg_check(const struct xt_tgchk_param *par)
+static int tproxy_tg_check(const struct xt_tgchk_param *par)
 {
        const struct ipt_ip *i = par->entryinfo;
 
index df7eaff874f1e75459dd0ee53725640a86e1b6c9..0e69427f8cda11ff15febd0f871bfe5b52791d32 100644 (file)
@@ -74,7 +74,7 @@ connmark_tg(struct sk_buff *skb, const struct xt_target_param *par)
        return XT_CONTINUE;
 }
 
-static bool connmark_tg_check(const struct xt_tgchk_param *par)
+static int connmark_tg_check(const struct xt_tgchk_param *par)
 {
        if (nf_ct_l3proto_try_module_get(par->family) < 0) {
                pr_info("cannot load conntrack support for proto=%u\n",