aboutsummaryrefslogtreecommitdiff
path: root/bpf_filter.c
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2020-07-03 16:26:06 -0700
committerGuy Harris <gharris@sonic.net>2020-07-03 16:26:06 -0700
commit505e35489a11a8dbbd5e3909e587608b7903eb5b (patch)
tree6d528d5c71c1aa200d793236e89d0b908318b1e1 /bpf_filter.c
parent992591533d502bf26526fe94362712b38b1a8391 (diff)
bpf_filter: suppress "switch has only a default case" warning.
Diffstat (limited to 'bpf_filter.c')
-rw-r--r--bpf_filter.c9
1 files changed, 9 insertions, 0 deletions
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 <pcap/pcap-inttypes.h>
#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: