Commit e8542dce authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Pablo Neira Ayuso

netfilter: mark expected switch fall-throughs

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.
Signed-off-by: default avatarGustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: default avatarSimon Horman <horms@verge.net.au>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 9dae47ab
...@@ -1386,7 +1386,7 @@ ip_set_dump_start(struct sk_buff *skb, struct netlink_callback *cb) ...@@ -1386,7 +1386,7 @@ ip_set_dump_start(struct sk_buff *skb, struct netlink_callback *cb)
goto next_set; goto next_set;
if (set->variant->uref) if (set->variant->uref)
set->variant->uref(set, cb, true); set->variant->uref(set, cb, true);
/* Fall through and add elements */ /* fall through */
default: default:
rcu_read_lock_bh(); rcu_read_lock_bh();
ret = set->variant->list(set, skb, cb); ret = set->variant->list(set, skb, cb);
......
...@@ -315,6 +315,7 @@ tcp_csum_check(int af, struct sk_buff *skb, struct ip_vs_protocol *pp) ...@@ -315,6 +315,7 @@ tcp_csum_check(int af, struct sk_buff *skb, struct ip_vs_protocol *pp)
switch (skb->ip_summed) { switch (skb->ip_summed) {
case CHECKSUM_NONE: case CHECKSUM_NONE:
skb->csum = skb_checksum(skb, tcphoff, skb->len - tcphoff, 0); skb->csum = skb_checksum(skb, tcphoff, skb->len - tcphoff, 0);
/* fall through */
case CHECKSUM_COMPLETE: case CHECKSUM_COMPLETE:
#ifdef CONFIG_IP_VS_IPV6 #ifdef CONFIG_IP_VS_IPV6
if (af == AF_INET6) { if (af == AF_INET6) {
......
...@@ -319,6 +319,7 @@ udp_csum_check(int af, struct sk_buff *skb, struct ip_vs_protocol *pp) ...@@ -319,6 +319,7 @@ udp_csum_check(int af, struct sk_buff *skb, struct ip_vs_protocol *pp)
case CHECKSUM_NONE: case CHECKSUM_NONE:
skb->csum = skb_checksum(skb, udphoff, skb->csum = skb_checksum(skb, udphoff,
skb->len - udphoff, 0); skb->len - udphoff, 0);
/* fall through */
case CHECKSUM_COMPLETE: case CHECKSUM_COMPLETE:
#ifdef CONFIG_IP_VS_IPV6 #ifdef CONFIG_IP_VS_IPV6
if (af == AF_INET6) { if (af == AF_INET6) {
......
...@@ -262,12 +262,15 @@ static unsigned int get_uint(struct bitstr *bs, int b) ...@@ -262,12 +262,15 @@ static unsigned int get_uint(struct bitstr *bs, int b)
case 4: case 4:
v |= *bs->cur++; v |= *bs->cur++;
v <<= 8; v <<= 8;
/* fall through */
case 3: case 3:
v |= *bs->cur++; v |= *bs->cur++;
v <<= 8; v <<= 8;
/* fall through */
case 2: case 2:
v |= *bs->cur++; v |= *bs->cur++;
v <<= 8; v <<= 8;
/* fall through */
case 1: case 1:
v |= *bs->cur++; v |= *bs->cur++;
break; break;
......
...@@ -44,6 +44,7 @@ static void nft_cmp_eval(const struct nft_expr *expr, ...@@ -44,6 +44,7 @@ static void nft_cmp_eval(const struct nft_expr *expr,
case NFT_CMP_LT: case NFT_CMP_LT:
if (d == 0) if (d == 0)
goto mismatch; goto mismatch;
/* fall through */
case NFT_CMP_LTE: case NFT_CMP_LTE:
if (d > 0) if (d > 0)
goto mismatch; goto mismatch;
...@@ -51,6 +52,7 @@ static void nft_cmp_eval(const struct nft_expr *expr, ...@@ -51,6 +52,7 @@ static void nft_cmp_eval(const struct nft_expr *expr,
case NFT_CMP_GT: case NFT_CMP_GT:
if (d == 0) if (d == 0)
goto mismatch; goto mismatch;
/* fall through */
case NFT_CMP_GTE: case NFT_CMP_GTE:
if (d < 0) if (d < 0)
goto mismatch; goto mismatch;
......
...@@ -1397,7 +1397,7 @@ static void *xt_mttg_seq_next(struct seq_file *seq, void *v, loff_t *ppos, ...@@ -1397,7 +1397,7 @@ static void *xt_mttg_seq_next(struct seq_file *seq, void *v, loff_t *ppos,
trav->curr = trav->curr->next; trav->curr = trav->curr->next;
if (trav->curr != trav->head) if (trav->curr != trav->head)
break; break;
/* fallthru, _stop will unlock */ /* fall through */
default: default:
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment