From db85e4bf22e7ef38c58e4684bf2fd30608f9b96e Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Fri, 2 Jan 2026 16:37:03 +0100 Subject: [PATCH] bpf: clat: add missing "break" statements --- src/core/bpf/clat.bpf.c | 4 ++++ src/core/bpf/meson.build | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/core/bpf/clat.bpf.c b/src/core/bpf/clat.bpf.c index ed87f81409..e4dd169364 100644 --- a/src/core/bpf/clat.bpf.c +++ b/src/core/bpf/clat.bpf.c @@ -209,6 +209,7 @@ rewrite_icmp(struct iphdr *iph, struct ipv6hdr *ip6h, struct __sk_buff *skb) icmp6.icmp6_type = ICMPV6_PARAMPROB; icmp6.icmp6_code = ICMPV6_UNK_NEXTHDR; icmp6.icmp6_pointer = bpf_htonl(offsetof(struct ipv6hdr, nexthdr)); + break; case ICMP_PORT_UNREACH: icmp6.icmp6_code = ICMPV6_PORT_UNREACH; break; @@ -222,11 +223,13 @@ rewrite_icmp(struct iphdr *iph, struct ipv6hdr *ip6h, struct __sk_buff *skb) if (mtu < 1280) mtu = 1280; icmp6.icmp6_mtu = bpf_htonl(mtu); + break; case ICMP_NET_ANO: case ICMP_HOST_ANO: case ICMP_PKT_FILTERED: case ICMP_PREC_CUTOFF: icmp6.icmp6_code = ICMPV6_ADM_PROHIBITED; + break; default: return -1; } @@ -271,6 +274,7 @@ rewrite_icmp(struct iphdr *iph, struct ipv6hdr *ip6h, struct __sk_buff *skb) default: return -1; } + break; default: return -1; } diff --git a/src/core/bpf/meson.build b/src/core/bpf/meson.build index 0ba2af16a9..39b978dd75 100644 --- a/src/core/bpf/meson.build +++ b/src/core/bpf/meson.build @@ -97,6 +97,7 @@ endif bpf_clang_flags = [ '-std=gnu17', '-Wunused', + '-Wimplicit-fallthrough', '-Wno-compare-distinct-pointer-types', '-fno-stack-protector', '-O2', @@ -109,6 +110,7 @@ bpf_clang_flags = [ bpf_gcc_flags = [ '-std=gnu17', '-Wunused', + '-Wimplicit-fallthrough', '-fno-stack-protector', '-fno-ssa-phiopt', '-O2',