From 505e35489a11a8dbbd5e3909e587608b7903eb5b Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Fri, 3 Jul 2020 16:26:06 -0700 Subject: bpf_filter: suppress "switch has only a default case" warning. --- bpf_filter.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'bpf_filter.c') diff --git a/bpf_filter.c b/bpf_filter.c index c41d0341..22d25587 100644 --- a/bpf_filter.c +++ b/bpf_filter.c @@ -45,6 +45,7 @@ #include #include "pcap-types.h" #include "extract.h" +#include "diag-control.h" #define EXTRACT_SHORT EXTRACT_BE_U_2 #define EXTRACT_LONG EXTRACT_BE_U_4 @@ -134,6 +135,13 @@ pcap_filter_with_aux_data(const struct bpf_insn *pc, const u_char *p, continue; case BPF_LD|BPF_B|BPF_ABS: + /* + * Yes, we know, this switch doesn't do + * anything unless we're building for + * a Linux kernel with removed VLAN + * tags available as meta-data. + */ +DIAG_OFF_DEFAULT_ONLY_SWITCH switch (pc->k) { #if defined(SKF_AD_VLAN_TAG_PRESENT) @@ -157,6 +165,7 @@ pcap_filter_with_aux_data(const struct bpf_insn *pc, const u_char *p, A = p[k]; break; } +DIAG_ON_DEFAULT_ONLY_SWITCH continue; case BPF_LD|BPF_W|BPF_LEN: -- cgit v1.2.3