netfilter: xtables: change xt_target.checkentry return type

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>
This commit is contained in:
Jan Engelhardt
2010-03-19 17:16:42 +01:00
parent b0f38452ff
commit 135367b8f6
33 changed files with 37 additions and 37 deletions

View File

@@ -342,8 +342,8 @@ struct xt_target {
/* Called when user tries to insert an entry of this type: /* Called when user tries to insert an entry of this type:
hook_mask is a bitmask of hooks from which it can be hook_mask is a bitmask of hooks from which it can be
called. */ called. */
/* Should return true or false. */ /* Should return true or false, or an error code (-Exxxx). */
bool (*checkentry)(const struct xt_tgchk_param *); int (*checkentry)(const struct xt_tgchk_param *);
/* Called when entry of this type deleted. */ /* Called when entry of this type deleted. */
void (*destroy)(const struct xt_tgdtor_param *); void (*destroy)(const struct xt_tgdtor_param *);

View File

@@ -57,7 +57,7 @@ ebt_arpreply_tg(struct sk_buff *skb, const struct xt_target_param *par)
return info->target; 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_arpreply_info *info = par->targinfo;
const struct ebt_entry *e = par->entryinfo; const struct ebt_entry *e = par->entryinfo;

View File

@@ -26,7 +26,7 @@ ebt_dnat_tg(struct sk_buff *skb, const struct xt_target_param *par)
return info->target; 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; const struct ebt_nat_info *info = par->targinfo;
unsigned int hook_mask; unsigned int hook_mask;

View File

@@ -24,7 +24,7 @@
static DEFINE_SPINLOCK(ebt_log_lock); 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; struct ebt_log_info *info = par->targinfo;

View File

@@ -36,7 +36,7 @@ ebt_mark_tg(struct sk_buff *skb, const struct xt_target_param *par)
return info->target | ~EBT_VERDICT_BITS; 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; const struct ebt_mark_t_info *info = par->targinfo;
int tmp; int tmp;

View File

@@ -35,7 +35,7 @@ ebt_nflog_tg(struct sk_buff *skb, const struct xt_target_param *par)
return EBT_CONTINUE; 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; struct ebt_nflog_info *info = par->targinfo;

View File

@@ -32,7 +32,7 @@ ebt_redirect_tg(struct sk_buff *skb, const struct xt_target_param *par)
return info->target; 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; const struct ebt_redirect_info *info = par->targinfo;
unsigned int hook_mask; unsigned int hook_mask;

View File

@@ -42,7 +42,7 @@ out:
return info->target | ~EBT_VERDICT_BITS; 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; const struct ebt_nat_info *info = par->targinfo;
int tmp; int tmp;

View File

@@ -249,7 +249,7 @@ ebt_ulog_tg(struct sk_buff *skb, const struct xt_target_param *par)
return EBT_CONTINUE; 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; struct ebt_ulog_info *uloginfo = par->targinfo;

View File

@@ -54,7 +54,7 @@ target(struct sk_buff *skb, const struct xt_target_param *par)
return mangle->target; 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; const struct arpt_mangle *mangle = par->targinfo;

View File

@@ -347,7 +347,7 @@ clusterip_tg(struct sk_buff *skb, const struct xt_target_param *par)
return XT_CONTINUE; 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; struct ipt_clusterip_tgt_info *cipinfo = par->targinfo;
const struct ipt_entry *e = par->entryinfo; const struct ipt_entry *e = par->entryinfo;

View File

@@ -93,7 +93,7 @@ ecn_tg(struct sk_buff *skb, const struct xt_target_param *par)
return XT_CONTINUE; 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_ECN_info *einfo = par->targinfo;
const struct ipt_entry *e = par->entryinfo; const struct ipt_entry *e = par->entryinfo;

View File

@@ -439,7 +439,7 @@ log_tg(struct sk_buff *skb, const struct xt_target_param *par)
return XT_CONTINUE; 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; const struct ipt_log_info *loginfo = par->targinfo;

View File

@@ -28,7 +28,7 @@ MODULE_AUTHOR("Netfilter Core Team <coreteam@netfilter.org>");
MODULE_DESCRIPTION("Xtables: automatic-address SNAT"); MODULE_DESCRIPTION("Xtables: automatic-address SNAT");
/* FIXME: Multiple targets. --RR */ /* 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; const struct nf_nat_multi_range_compat *mr = par->targinfo;

View File

@@ -22,7 +22,7 @@ MODULE_LICENSE("GPL");
MODULE_AUTHOR("Svenning Soerensen <svenning@post5.tele.dk>"); MODULE_AUTHOR("Svenning Soerensen <svenning@post5.tele.dk>");
MODULE_DESCRIPTION("Xtables: 1:1 NAT mapping of IPv4 subnets"); 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; const struct nf_nat_multi_range_compat *mr = par->targinfo;

View File

@@ -26,7 +26,7 @@ MODULE_AUTHOR("Netfilter Core Team <coreteam@netfilter.org>");
MODULE_DESCRIPTION("Xtables: Connection redirection to localhost"); MODULE_DESCRIPTION("Xtables: Connection redirection to localhost");
/* FIXME: Take multiple ranges --RR */ /* 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; const struct nf_nat_multi_range_compat *mr = par->targinfo;

View File

@@ -174,7 +174,7 @@ reject_tg(struct sk_buff *skb, const struct xt_target_param *par)
return NF_DROP; 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_reject_info *rejinfo = par->targinfo;
const struct ipt_entry *e = par->entryinfo; const struct ipt_entry *e = par->entryinfo;

View File

@@ -307,7 +307,7 @@ static void ipt_logfn(u_int8_t pf,
ipt_ulog_packet(hooknum, skb, in, out, &loginfo, prefix); 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; const struct ipt_ulog_info *loginfo = par->targinfo;

View 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); 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; 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; 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; const struct nf_nat_multi_range_compat *mr = par->targinfo;

View 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; const struct ip6t_log_info *loginfo = par->targinfo;

Some files were not shown because too many files have changed in this diff Show More