Skip to content

Commit 7912118

Browse files
ipv4: Fix fall-through warnings for Clang
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: KSPP#115 Signed-off-by: Gustavo A. R. Silva <[email protected]>
1 parent d66aea4 commit 7912118

File tree

5 files changed

+5
-0
lines changed

5 files changed

+5
-0
lines changed

net/ipv4/ah4.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@ static int ah4_err(struct sk_buff *skb, u32 info)
450450
case ICMP_DEST_UNREACH:
451451
if (icmp_hdr(skb)->code != ICMP_FRAG_NEEDED)
452452
return 0;
453+
break;
453454
case ICMP_REDIRECT:
454455
break;
455456
default:

net/ipv4/esp4.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,7 @@ static int esp4_err(struct sk_buff *skb, u32 info)
982982
case ICMP_DEST_UNREACH:
983983
if (icmp_hdr(skb)->code != ICMP_FRAG_NEEDED)
984984
return 0;
985+
break;
985986
case ICMP_REDIRECT:
986987
break;
987988
default:

net/ipv4/fib_semantics.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1874,6 +1874,7 @@ static int call_fib_nh_notifiers(struct fib_nh *nh,
18741874
(nh->fib_nh_flags & RTNH_F_DEAD))
18751875
return call_fib4_notifiers(dev_net(nh->fib_nh_dev),
18761876
event_type, &info.info);
1877+
break;
18771878
default:
18781879
break;
18791880
}

net/ipv4/ip_vti.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ static int vti4_err(struct sk_buff *skb, u32 info)
351351
case ICMP_DEST_UNREACH:
352352
if (icmp_hdr(skb)->code != ICMP_FRAG_NEEDED)
353353
return 0;
354+
break;
354355
case ICMP_REDIRECT:
355356
break;
356357
default:

net/ipv4/ipcomp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ static int ipcomp4_err(struct sk_buff *skb, u32 info)
3131
case ICMP_DEST_UNREACH:
3232
if (icmp_hdr(skb)->code != ICMP_FRAG_NEEDED)
3333
return 0;
34+
break;
3435
case ICMP_REDIRECT:
3536
break;
3637
default:

0 commit comments

Comments
 (0)