Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 135367b8 authored by Jan Engelhardt's avatar Jan Engelhardt
Browse files

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: default avatarJan Engelhardt <jengelh@medozas.de>
parent b0f38452
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -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 *);
+1 −1
Original line number Original line Diff line number Diff line
@@ -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;
+1 −1
Original line number Original line Diff line number Diff line
@@ -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;
+1 −1
Original line number Original line Diff line number Diff line
@@ -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;


+1 −1
Original line number Original line Diff line number Diff line
@@ -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;
Loading