[NETFILTER]: x_tables: switch xt_match->checkentry to bool
Switch the return type of match functions to boolean Signed-off-by: Jan Engelhardt <jengelh@gmx.de> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
1d93a9cbad
commit
ccb79bdce7
@@ -188,20 +188,20 @@ ip6_packet_match(const struct sk_buff *skb,
|
||||
}
|
||||
|
||||
/* should be ip6 safe */
|
||||
static inline int
|
||||
static inline bool
|
||||
ip6_checkentry(const struct ip6t_ip6 *ipv6)
|
||||
{
|
||||
if (ipv6->flags & ~IP6T_F_MASK) {
|
||||
duprintf("Unknown flag bits set: %08X\n",
|
||||
ipv6->flags & ~IP6T_F_MASK);
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
if (ipv6->invflags & ~IP6T_INV_MASK) {
|
||||
duprintf("Unknown invflag bits set: %08X\n",
|
||||
ipv6->invflags & ~IP6T_INV_MASK);
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
@@ -1282,10 +1282,10 @@ void ip6t_unregister_table(struct xt_table *table)
|
||||
}
|
||||
|
||||
/* Returns 1 if the type and code is matched by the range, 0 otherwise */
|
||||
static inline int
|
||||
static inline bool
|
||||
icmp6_type_code_match(u_int8_t test_type, u_int8_t min_code, u_int8_t max_code,
|
||||
u_int8_t type, u_int8_t code,
|
||||
int invert)
|
||||
bool invert)
|
||||
{
|
||||
return (type == test_type && code >= min_code && code <= max_code)
|
||||
^ invert;
|
||||
@@ -1325,7 +1325,7 @@ icmp6_match(const struct sk_buff *skb,
|
||||
}
|
||||
|
||||
/* Called when user tries to insert an entry of this type. */
|
||||
static int
|
||||
static bool
|
||||
icmp6_checkentry(const char *tablename,
|
||||
const void *entry,
|
||||
const struct xt_match *match,
|
||||
|
@@ -103,7 +103,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 *entry,
|
||||
const struct xt_match *match,
|
||||
@@ -114,9 +114,9 @@ checkentry(const char *tablename,
|
||||
|
||||
if (ahinfo->invflags & ~IP6T_AH_INV_MASK) {
|
||||
DEBUGP("ip6t_ah: unknown flags %X\n", ahinfo->invflags);
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
static struct xt_match ah_match = {
|
||||
|
@@ -120,7 +120,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,
|
||||
const struct xt_match *match,
|
||||
@@ -131,9 +131,9 @@ checkentry(const char *tablename,
|
||||
|
||||
if (fraginfo->invflags & ~IP6T_FRAG_INV_MASK) {
|
||||
DEBUGP("ip6t_frag: unknown flags %X\n", fraginfo->invflags);
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
static struct xt_match frag_match = {
|
||||
|
@@ -174,7 +174,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 *entry,
|
||||
const struct xt_match *match,
|
||||
@@ -185,9 +185,9 @@ checkentry(const char *tablename,
|
||||
|
||||
if (optsinfo->invflags & ~IP6T_OPTS_INV_MASK) {
|
||||
DEBUGP("ip6t_opts: unknown flags %X\n", optsinfo->invflags);
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
static struct xt_match opts_match[] = {
|
||||
|
@@ -124,7 +124,7 @@ ipv6header_match(const struct sk_buff *skb,
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
static bool
|
||||
ipv6header_checkentry(const char *tablename,
|
||||
const void *ip,
|
||||
const struct xt_match *match,
|
||||
@@ -136,9 +136,9 @@ ipv6header_checkentry(const char *tablename,
|
||||
/* invflags is 0 or 0xff in hard mode */
|
||||
if ((!info->modeflag) && info->invflags != 0x00 &&
|
||||
info->invflags != 0xFF)
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
static struct xt_match ip6t_ipv6header_match = {
|
||||
|
@@ -75,7 +75,7 @@ match(const struct sk_buff *skb,
|
||||
}
|
||||
|
||||
/* Called when user tries to insert an entry of this type. */
|
||||
static int
|
||||
static bool
|
||||
mh_checkentry(const char *tablename,
|
||||
const void *entry,
|
||||
const struct xt_match *match,
|
||||
|
@@ -53,7 +53,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,
|
||||
@@ -65,9 +65,9 @@ checkentry(const char *tablename,
|
||||
if (info->match & (IP6T_OWNER_PID | IP6T_OWNER_SID)) {
|
||||
printk("ipt_owner: pid and sid matching "
|
||||
"not supported anymore\n");
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
static struct xt_match owner_match = {
|
||||
|
@@ -198,7 +198,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 *entry,
|
||||
const struct xt_match *match,
|
||||
@@ -209,17 +209,17 @@ checkentry(const char *tablename,
|
||||
|
||||
if (rtinfo->invflags & ~IP6T_RT_INV_MASK) {
|
||||
DEBUGP("ip6t_rt: unknown flags %X\n", rtinfo->invflags);
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
if ((rtinfo->flags & (IP6T_RT_RES | IP6T_RT_FST_MASK)) &&
|
||||
(!(rtinfo->flags & IP6T_RT_TYP) ||
|
||||
(rtinfo->rt_type != 0) ||
|
||||
(rtinfo->invflags & IP6T_RT_INV_TYP))) {
|
||||
DEBUGP("`--rt-type 0' required before `--rt-0-*'");
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
static struct xt_match rt_match = {
|
||||
|
Reference in New Issue
Block a user