Skip to content

Commit d384e65

Browse files
GustavoARSilvaummakynes
authored andcommitted
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: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent 3ecbfd6 commit d384e65

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎net/netfilter/nf_conncount.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static inline bool already_closed(const struct nf_conn *conn)
7171
return conn->proto.tcp.state == TCP_CONNTRACK_TIME_WAIT ||
7272
conn->proto.tcp.state == TCP_CONNTRACK_CLOSE;
7373
else
74-
return 0;
74+
return false;
7575
}
7676

7777
static int key_diff(const u32 *a, const u32 *b, unsigned int klen)

‎net/netfilter/xt_hashlimit.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ static int htable_create(struct net *net, struct hashlimit_cfg3 *cfg,
353353
static bool select_all(const struct xt_hashlimit_htable *ht,
354354
const struct dsthash_ent *he)
355355
{
356-
return 1;
356+
return true;
357357
}
358358

359359
static bool select_gc(const struct xt_hashlimit_htable *ht,

‎net/netfilter/xt_ipcomp.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static bool comp_mt(const struct sk_buff *skb, struct xt_action_param *par)
5858
*/
5959
pr_debug("Dropping evil IPComp tinygram.\n");
6060
par->hotdrop = true;
61-
return 0;
61+
return false;
6262
}
6363

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

0 commit comments

Comments
 (0)