提交 d384e65f 编写于 作者: G Gustavo A. R. Silva 提交者: Pablo Neira Ayuso

netfilter: return booleans instead of integers

Return statements in functions returning bool should use
true/false instead of 1/0.

These issues were detected with the help of Coccinelle.
Signed-off-by: NGustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
上级 3ecbfd65
...@@ -71,7 +71,7 @@ static inline bool already_closed(const struct nf_conn *conn) ...@@ -71,7 +71,7 @@ static inline bool already_closed(const struct nf_conn *conn)
return conn->proto.tcp.state == TCP_CONNTRACK_TIME_WAIT || return conn->proto.tcp.state == TCP_CONNTRACK_TIME_WAIT ||
conn->proto.tcp.state == TCP_CONNTRACK_CLOSE; conn->proto.tcp.state == TCP_CONNTRACK_CLOSE;
else else
return 0; return false;
} }
static int key_diff(const u32 *a, const u32 *b, unsigned int klen) static int key_diff(const u32 *a, const u32 *b, unsigned int klen)
......
...@@ -353,7 +353,7 @@ static int htable_create(struct net *net, struct hashlimit_cfg3 *cfg, ...@@ -353,7 +353,7 @@ static int htable_create(struct net *net, struct hashlimit_cfg3 *cfg,
static bool select_all(const struct xt_hashlimit_htable *ht, static bool select_all(const struct xt_hashlimit_htable *ht,
const struct dsthash_ent *he) const struct dsthash_ent *he)
{ {
return 1; return true;
} }
static bool select_gc(const struct xt_hashlimit_htable *ht, static bool select_gc(const struct xt_hashlimit_htable *ht,
......
...@@ -58,7 +58,7 @@ static bool comp_mt(const struct sk_buff *skb, struct xt_action_param *par) ...@@ -58,7 +58,7 @@ static bool comp_mt(const struct sk_buff *skb, struct xt_action_param *par)
*/ */
pr_debug("Dropping evil IPComp tinygram.\n"); pr_debug("Dropping evil IPComp tinygram.\n");
par->hotdrop = true; par->hotdrop = true;
return 0; return false;
} }
return spi_match(compinfo->spis[0], compinfo->spis[1], return spi_match(compinfo->spis[0], compinfo->spis[1],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册