aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustavo A. R. Silva <garsilva@embeddedor.com>2018-01-18 18:25:12 -0500
committerPablo Neira Ayuso <pablo@netfilter.org>2018-01-19 08:02:18 -0500
commitd384e65f1e752f2b52a8ef300aeb86b1d7a342a9 (patch)
tree63798288f48091f5bfa55c609fe2ba66265894bd
parent3ecbfd65f50e5ff9c538c1bfa3356ef52cc66586 (diff)
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>
-rw-r--r--net/netfilter/nf_conncount.c2
-rw-r--r--net/netfilter/xt_hashlimit.c2
-rw-r--r--net/netfilter/xt_ipcomp.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/net/netfilter/nf_conncount.c b/net/netfilter/nf_conncount.c
index a95518261168..6d65389e308f 100644
--- a/net/netfilter/nf_conncount.c
+++ b/net/netfilter/nf_conncount.c
@@ -71,7 +71,7 @@ static inline bool already_closed(const struct nf_conn *conn)
71 return conn->proto.tcp.state == TCP_CONNTRACK_TIME_WAIT || 71 return conn->proto.tcp.state == TCP_CONNTRACK_TIME_WAIT ||
72 conn->proto.tcp.state == TCP_CONNTRACK_CLOSE; 72 conn->proto.tcp.state == TCP_CONNTRACK_CLOSE;
73 else 73 else
74 return 0; 74 return false;
75} 75}
76 76
77static int key_diff(const u32 *a, const u32 *b, unsigned int klen) 77static int key_diff(const u32 *a, const u32 *b, unsigned int klen)
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c
index 5da8746f7b88..ec51d9a9512d 100644
--- a/net/netfilter/xt_hashlimit.c
+++ b/net/netfilter/xt_hashlimit.c
@@ -353,7 +353,7 @@ static int htable_create(struct net *net, struct hashlimit_cfg3 *cfg,
353static bool select_all(const struct xt_hashlimit_htable *ht, 353static bool select_all(const struct xt_hashlimit_htable *ht,
354 const struct dsthash_ent *he) 354 const struct dsthash_ent *he)
355{ 355{
356 return 1; 356 return true;
357} 357}
358 358
359static bool select_gc(const struct xt_hashlimit_htable *ht, 359static bool select_gc(const struct xt_hashlimit_htable *ht,
diff --git a/net/netfilter/xt_ipcomp.c b/net/netfilter/xt_ipcomp.c
index 000e70377f85..7ca64a50db04 100644
--- a/net/netfilter/xt_ipcomp.c
+++ b/net/netfilter/xt_ipcomp.c
@@ -58,7 +58,7 @@ static bool comp_mt(const struct sk_buff *skb, struct xt_action_param *par)
58 */ 58 */
59 pr_debug("Dropping evil IPComp tinygram.\n"); 59 pr_debug("Dropping evil IPComp tinygram.\n");
60 par->hotdrop = true; 60 par->hotdrop = true;
61 return 0; 61 return false;
62 } 62 }
63 63
64 return spi_match(compinfo->spis[0], compinfo->spis[1], 64 return spi_match(compinfo->spis[0], compinfo->spis[1],