From 44bea80d3cc1f90131bb9c289b1996dec36de475 Mon Sep 17 00:00:00 2001 From: Max Fillinger Date: Mon, 8 Jul 2019 16:51:46 +0200 Subject: [PATCH] decode erspan: Always fill in vlan_id Fill in the vlan_id fields unconditionally. We can now remove the check for the vlan.use-for-tracking setting in decode.c. The debug log message is moved to suricata.c. --- src/decode-erspan.c | 2 +- src/decode.c | 7 ------- src/decode.h | 2 -- src/suricata.c | 1 + 4 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/decode-erspan.c b/src/decode-erspan.c index 53f43fa240..21aa3bf40f 100644 --- a/src/decode-erspan.c +++ b/src/decode-erspan.c @@ -64,7 +64,7 @@ int DecodeERSPAN(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, uint8_t *pkt, return TM_ECODE_FAILED; } - if (vlan_id > 0 && dtv->vlan_disabled == 0) { + if (vlan_id > 0) { if (p->vlan_idx >= 2) { ENGINE_SET_EVENT(p,ERSPAN_TOO_MANY_VLAN_LAYERS); return TM_ECODE_FAILED; diff --git a/src/decode.c b/src/decode.c index 48af810dee..f0f793f81c 100644 --- a/src/decode.c +++ b/src/decode.c @@ -618,13 +618,6 @@ DecodeThreadVars *DecodeThreadVarsAlloc(ThreadVars *tv) return NULL; } - /** set config defaults */ - int vlanbool = 0; - if ((ConfGetBool("vlan.use-for-tracking", &vlanbool)) == 1 && vlanbool == 0) { - dtv->vlan_disabled = 1; - } - SCLogDebug("vlan tracking is %s", dtv->vlan_disabled == 0 ? "enabled" : "disabled"); - return dtv; } diff --git a/src/decode.h b/src/decode.h index 6cb54c01fe..4488c05511 100644 --- a/src/decode.h +++ b/src/decode.h @@ -634,8 +634,6 @@ typedef struct DecodeThreadVars_ /** Specific context for udp protocol detection (here atm) */ AppLayerThreadCtx *app_tctx; - int vlan_disabled; - /** stats/counters */ uint16_t counter_pkts; uint16_t counter_bytes; diff --git a/src/suricata.c b/src/suricata.c index 49eadee5e5..dc4843b1fa 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -2976,6 +2976,7 @@ int main(int argc, char **argv) /* Ignore vlan_ids when comparing flows. */ g_vlan_mask = 0x0000; } + SCLogDebug("vlan tracking is %s", vlan_tracking == 1 ? "enabled" : "disabled"); SetupUserMode(&suricata);