bpf: clat: add missing "break" statements

This commit is contained in:
Beniamino Galvani 2026-01-02 16:37:03 +01:00
parent 61f97032c4
commit db85e4bf22
2 changed files with 6 additions and 0 deletions

View file

@ -209,6 +209,7 @@ rewrite_icmp(struct iphdr *iph, struct ipv6hdr *ip6h, struct __sk_buff *skb)
icmp6.icmp6_type = ICMPV6_PARAMPROB; icmp6.icmp6_type = ICMPV6_PARAMPROB;
icmp6.icmp6_code = ICMPV6_UNK_NEXTHDR; icmp6.icmp6_code = ICMPV6_UNK_NEXTHDR;
icmp6.icmp6_pointer = bpf_htonl(offsetof(struct ipv6hdr, nexthdr)); icmp6.icmp6_pointer = bpf_htonl(offsetof(struct ipv6hdr, nexthdr));
break;
case ICMP_PORT_UNREACH: case ICMP_PORT_UNREACH:
icmp6.icmp6_code = ICMPV6_PORT_UNREACH; icmp6.icmp6_code = ICMPV6_PORT_UNREACH;
break; break;
@ -222,11 +223,13 @@ rewrite_icmp(struct iphdr *iph, struct ipv6hdr *ip6h, struct __sk_buff *skb)
if (mtu < 1280) if (mtu < 1280)
mtu = 1280; mtu = 1280;
icmp6.icmp6_mtu = bpf_htonl(mtu); icmp6.icmp6_mtu = bpf_htonl(mtu);
break;
case ICMP_NET_ANO: case ICMP_NET_ANO:
case ICMP_HOST_ANO: case ICMP_HOST_ANO:
case ICMP_PKT_FILTERED: case ICMP_PKT_FILTERED:
case ICMP_PREC_CUTOFF: case ICMP_PREC_CUTOFF:
icmp6.icmp6_code = ICMPV6_ADM_PROHIBITED; icmp6.icmp6_code = ICMPV6_ADM_PROHIBITED;
break;
default: default:
return -1; return -1;
} }
@ -271,6 +274,7 @@ rewrite_icmp(struct iphdr *iph, struct ipv6hdr *ip6h, struct __sk_buff *skb)
default: default:
return -1; return -1;
} }
break;
default: default:
return -1; return -1;
} }

View file

@ -97,6 +97,7 @@ endif
bpf_clang_flags = [ bpf_clang_flags = [
'-std=gnu17', '-std=gnu17',
'-Wunused', '-Wunused',
'-Wimplicit-fallthrough',
'-Wno-compare-distinct-pointer-types', '-Wno-compare-distinct-pointer-types',
'-fno-stack-protector', '-fno-stack-protector',
'-O2', '-O2',
@ -109,6 +110,7 @@ bpf_clang_flags = [
bpf_gcc_flags = [ bpf_gcc_flags = [
'-std=gnu17', '-std=gnu17',
'-Wunused', '-Wunused',
'-Wimplicit-fallthrough',
'-fno-stack-protector', '-fno-stack-protector',
'-fno-ssa-phiopt', '-fno-ssa-phiopt',
'-O2', '-O2',