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

Commit ccb79bdc authored by Jan Engelhardt's avatar Jan Engelhardt Committed by David S. Miller
Browse files

[NETFILTER]: x_tables: switch xt_match->checkentry to bool



Switch the return type of match functions to boolean

Signed-off-by: default avatarJan Engelhardt <jengelh@gmx.de>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1d93a9cb
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -152,7 +152,7 @@ struct xt_match

	/* Called when user tries to insert an entry of this type. */
	/* Should return true or false. */
	int (*checkentry)(const char *tablename,
	bool (*checkentry)(const char *tablename,
			   const void *ip,
			   const struct xt_match *match,
			   void *matchinfo,
+5 −5
Original line number Diff line number Diff line
@@ -152,20 +152,20 @@ ip_packet_match(const struct iphdr *ip,
	return 1;
}

static inline int
static inline bool
ip_checkentry(const struct ipt_ip *ip)
{
	if (ip->flags & ~IPT_F_MASK) {
		duprintf("Unknown flag bits set: %08X\n",
			 ip->flags & ~IPT_F_MASK);
		return 0;
		return false;
	}
	if (ip->invflags & ~IPT_INV_MASK) {
		duprintf("Unknown invflag bits set: %08X\n",
			 ip->invflags & ~IPT_INV_MASK);
		return 0;
		return false;
	}
	return 1;
	return true;
}

static unsigned int
@@ -2149,7 +2149,7 @@ icmp_match(const struct sk_buff *skb,
}

/* Called when user tries to insert an entry of this type. */
static int
static bool
icmp_checkentry(const char *tablename,
	   const void *info,
	   const struct xt_match *match,
+3 −3
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ match(const struct sk_buff *skb,
}

/* Called when user tries to insert an entry of this type. */
static int
static bool
checkentry(const char *tablename,
	   const void *ip_void,
	   const struct xt_match *match,
@@ -82,9 +82,9 @@ checkentry(const char *tablename,
	/* Must specify no unknown invflags */
	if (ahinfo->invflags & ~IPT_AH_INV_MASK) {
		duprintf("ipt_ah: unknown flags %X\n", ahinfo->invflags);
		return 0;
		return false;
	}
	return 1;
	return true;
}

static struct xt_match ah_match = {
+7 −7
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ static bool match(const struct sk_buff *skb,
	return true;
}

static int checkentry(const char *tablename, const void *ip_void,
static bool checkentry(const char *tablename, const void *ip_void,
		       const struct xt_match *match,
		       void *matchinfo, unsigned int hook_mask)
{
@@ -95,19 +95,19 @@ static int checkentry(const char *tablename, const void *ip_void,
	const struct ipt_ip *ip = ip_void;

	if (info->operation & IPT_ECN_OP_MATCH_MASK)
		return 0;
		return false;

	if (info->invert & IPT_ECN_OP_MATCH_MASK)
		return 0;
		return false;

	if (info->operation & (IPT_ECN_OP_MATCH_ECE|IPT_ECN_OP_MATCH_CWR)
	    && ip->proto != IPPROTO_TCP) {
		printk(KERN_WARNING "ipt_ecn: can't match TCP bits in rule for"
		       " non-tcp packets\n");
		return 0;
		return false;
	}

	return 1;
	return true;
}

static struct xt_match ecn_match = {
+3 −3
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ match(const struct sk_buff *skb,
	return true;
}

static int
static bool
checkentry(const char *tablename,
	   const void *ip,
	   const struct xt_match *match,
@@ -63,9 +63,9 @@ checkentry(const char *tablename,
	if (info->match & (IPT_OWNER_PID|IPT_OWNER_SID|IPT_OWNER_COMM)) {
		printk("ipt_owner: pid, sid and command matching "
		       "not supported anymore\n");
		return 0;
		return false;
	}
	return 1;
	return true;
}

static struct xt_match owner_match = {
Loading