Skip to content

Commit

Permalink
netfilter: return booleans instead of integers
Browse files Browse the repository at this point in the history
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: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Gustavo A. R. Silva authored and Pablo Neira Ayuso committed Jan 19, 2018
1 parent 3ecbfd6 commit d384e65
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion net/netfilter/nf_conncount.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static inline bool already_closed(const struct nf_conn *conn)
return conn->proto.tcp.state == TCP_CONNTRACK_TIME_WAIT ||
conn->proto.tcp.state == TCP_CONNTRACK_CLOSE;
else
return 0;
return false;
}

static int key_diff(const u32 *a, const u32 *b, unsigned int klen)
Expand Down
2 changes: 1 addition & 1 deletion net/netfilter/xt_hashlimit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
const struct dsthash_ent *he)
{
return 1;
return true;
}

static bool select_gc(const struct xt_hashlimit_htable *ht,
Expand Down
2 changes: 1 addition & 1 deletion net/netfilter/xt_ipcomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
par->hotdrop = true;
return 0;
return false;
}

return spi_match(compinfo->spis[0], compinfo->spis[1],
Expand Down

0 comments on commit d384e65

Please sign in to comment.