[conntrack-tools] conntrackd: add missing fall-through annotation in switch statements

Message ID 152389825033.32583.14594499960094575906.stgit@endurance
State Accepted
Delegated to: Pablo Neira
Headers show
Series
  • [conntrack-tools] conntrackd: add missing fall-through annotation in switch statements
Related show

Commit Message

Arturo Borrero Gonzalez April 16, 2018, 5:04 p.m.
Modern GCC compilers will warn if an explicit comment isn't present.
Perhaps this should be better done with a proper compiler instruction,
but the code comment is more similar to the rest of the codebase.

Signed-off-by: Arturo Borrero Gonzalez <arturo@netfilter.org>
---
 src/cache-ct.c  |    2 ++
 src/cache-exp.c |    1 +
 src/tcp.c       |    1 +
 3 files changed, 4 insertions(+)


--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/src/cache-ct.c b/src/cache-ct.c
index f86d143..fa5072c 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..acdae10 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);