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

Commit b0f38452 authored by Jan Engelhardt's avatar Jan Engelhardt
Browse files

netfilter: xtables: change xt_match.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.

This semantic patch may not be too precise (checking for functions
that use xt_mtchk_param rather than functions referenced by
xt_match.checkentry), but reviewed, it produced the intended result.

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

Signed-off-by: default avatarJan Engelhardt <jengelh@medozas.de>
parent 9f567317
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -303,7 +303,7 @@ struct xt_match {
		      const struct xt_match_param *);

	/* Called when user tries to insert an entry of this type. */
	bool (*checkentry)(const struct xt_mtchk_param *);
	int (*checkentry)(const struct xt_mtchk_param *);

	/* Called when entry of this type deleted. */
	void (*destroy)(const struct xt_mtdtor_param *);
+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ ebt_802_3_mt(const struct sk_buff *skb, const struct xt_match_param *par)
	return true;
}

static bool ebt_802_3_mt_check(const struct xt_mtchk_param *par)
static int ebt_802_3_mt_check(const struct xt_mtchk_param *par)
{
	const struct ebt_802_3_info *info = par->matchinfo;

+1 −1
Original line number Diff line number Diff line
@@ -172,7 +172,7 @@ ebt_among_mt(const struct sk_buff *skb, const struct xt_match_param *par)
	return true;
}

static bool ebt_among_mt_check(const struct xt_mtchk_param *par)
static int ebt_among_mt_check(const struct xt_mtchk_param *par)
{
	const struct ebt_among_info *info = par->matchinfo;
	const struct ebt_entry_match *em =
+1 −1
Original line number Diff line number Diff line
@@ -100,7 +100,7 @@ ebt_arp_mt(const struct sk_buff *skb, const struct xt_match_param *par)
	return true;
}

static bool ebt_arp_mt_check(const struct xt_mtchk_param *par)
static int ebt_arp_mt_check(const struct xt_mtchk_param *par)
{
	const struct ebt_arp_info *info = par->matchinfo;
	const struct ebt_entry *e = par->entryinfo;
+1 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ ebt_ip_mt(const struct sk_buff *skb, const struct xt_match_param *par)
	return true;
}

static bool ebt_ip_mt_check(const struct xt_mtchk_param *par)
static int ebt_ip_mt_check(const struct xt_mtchk_param *par)
{
	const struct ebt_ip_info *info = par->matchinfo;
	const struct ebt_entry *e = par->entryinfo;
Loading