summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2019-02-13 00:13:44 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2019-02-13 18:23:47 +0100
commite63c283c4e6a71df358bd12e4ba2fe49c1619d82 (patch)
treecdcce0a316452b2e7620d9a0c460cfa1e7a7bcdf
parent9b477e07e00bc2d651784d7c82c2123f0bd7386b (diff)
src: Fix for implicit-fallthrough warnings
Mark fall through cases as such. Note that correctness of those fall throughs have not been verified. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--include/jhash.h2
-rw-r--r--src/cache-ct.c2
-rw-r--r--src/cache-exp.c1
-rw-r--r--src/tcp.c1
4 files changed, 5 insertions, 1 deletions
diff --git a/include/jhash.h b/include/jhash.h
index d164e38..9793452 100644
--- a/include/jhash.h
+++ b/include/jhash.h
@@ -106,7 +106,7 @@ static inline u32 jhash2(const u32 *k, u32 length, u32 initval)
c += length * 4;
switch (len) {
- case 2 : b += k[1];
+ case 2 : b += k[1]; /* fall through */
case 1 : a += k[0];
};
diff --git a/src/cache-ct.c b/src/cache-ct.c
index f86d143..abcfde4 100644
--- a/src/cache-ct.c
+++ b/src/cache-ct.c
@@ -266,6 +266,7 @@ static int cache_ct_commit(struct cache *c, struct nfct_handle *h, int clientfd)
STATE_SYNC(commit).stats.ok = c->stats.commit_ok;
STATE_SYNC(commit).stats.fail = c->stats.commit_fail;
STATE_SYNC(commit).clientfd = clientfd;
+ /* fall through */
case COMMIT_STATE_MASTER:
STATE_SYNC(commit).current =
hashtable_iterate_limit(c->h, &tmp,
@@ -280,6 +281,7 @@ static int cache_ct_commit(struct cache *c, struct nfct_handle *h, int clientfd)
}
STATE_SYNC(commit).current = 0;
STATE_SYNC(commit).state = COMMIT_STATE_RELATED;
+ /* fall through */
case COMMIT_STATE_RELATED:
STATE_SYNC(commit).current =
hashtable_iterate_limit(c->h, &tmp,
diff --git a/src/cache-exp.c b/src/cache-exp.c
index 9183b2c..63e3440 100644
--- a/src/cache-exp.c
+++ b/src/cache-exp.c
@@ -236,6 +236,7 @@ cache_exp_commit(struct cache *c, struct nfct_handle *h, int clientfd)
STATE_SYNC(commit).stats.ok = c->stats.commit_ok;
STATE_SYNC(commit).stats.fail = c->stats.commit_fail;
STATE_SYNC(commit).clientfd = clientfd;
+ /* fall through */
case COMMIT_STATE_MASTER:
STATE_SYNC(commit).current =
hashtable_iterate_limit(c->h, &tmp,
diff --git a/src/tcp.c b/src/tcp.c
index c8f2544..91fe524 100644
--- a/src/tcp.c
+++ b/src/tcp.c
@@ -300,6 +300,7 @@ ssize_t tcp_send(struct tcp_sock *m, const void *data, int size)
/* we got connected :) */
m->state = TCP_CLIENT_CONNECTED;
}
+ /* fall through */
case TCP_CLIENT_CONNECTED:
ret = sendto(m->fd, data, size, 0,
(struct sockaddr *) &m->addr, m->sockaddr_len);