ipv4: Fix fall-through warnings for Clang
authorGustavo A. R. Silva <gustavoars@kernel.org>
Fri, 20 Nov 2020 18:25:57 +0000 (12:25 -0600)
committerGustavo A. R. Silva <gustavoars@kernel.org>
Tue, 18 May 2021 00:29:10 +0000 (19:29 -0500)
In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple
warnings by explicitly adding multiple break statements instead of just
letting the code fall through to the next case.

Link: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
net/ipv4/ah4.c
net/ipv4/esp4.c
net/ipv4/fib_semantics.c
net/ipv4/ip_vti.c
net/ipv4/ipcomp.c

index 36ed85bf2ad51cfd80bf374a54aa7e0815872997..fab0958c41bed4cf81d2a7e4d8980c0d64ae3306 100644 (file)
@@ -450,6 +450,7 @@ static int ah4_err(struct sk_buff *skb, u32 info)
        case ICMP_DEST_UNREACH:
                if (icmp_hdr(skb)->code != ICMP_FRAG_NEEDED)
                        return 0;
+               break;
        case ICMP_REDIRECT:
                break;
        default:
index 35803ab7ac8048397227340c7c675c3cb7a95c5e..8e3b445a8c21953a26808118249399001767dddb 100644 (file)
@@ -982,6 +982,7 @@ static int esp4_err(struct sk_buff *skb, u32 info)
        case ICMP_DEST_UNREACH:
                if (icmp_hdr(skb)->code != ICMP_FRAG_NEEDED)
                        return 0;
+               break;
        case ICMP_REDIRECT:
                break;
        default:
index a632b66bc13abbd0ef4de1559182a21fd8701fde..4c0c33e4710dae8cb425e4132a394b1ad52e3ae6 100644 (file)
@@ -1874,6 +1874,7 @@ static int call_fib_nh_notifiers(struct fib_nh *nh,
                    (nh->fib_nh_flags & RTNH_F_DEAD))
                        return call_fib4_notifiers(dev_net(nh->fib_nh_dev),
                                                   event_type, &info.info);
+               break;
        default:
                break;
        }
index 31c6c6d99d5ecf6ff1752c450c46981f8eac7da0..eb560eecee089e6b51e970913eb5b43946096a03 100644 (file)
@@ -351,6 +351,7 @@ static int vti4_err(struct sk_buff *skb, u32 info)
        case ICMP_DEST_UNREACH:
                if (icmp_hdr(skb)->code != ICMP_FRAG_NEEDED)
                        return 0;
+               break;
        case ICMP_REDIRECT:
                break;
        default:
index b42683212c6590d2e81e060fb5c8e9907d4db917..bbb56f5e06dde0ac3dd138681a16d5f46f16173a 100644 (file)
@@ -31,6 +31,7 @@ static int ipcomp4_err(struct sk_buff *skb, u32 info)
        case ICMP_DEST_UNREACH:
                if (icmp_hdr(skb)->code != ICMP_FRAG_NEEDED)
                        return 0;
+               break;
        case ICMP_REDIRECT:
                break;
        default: