]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
decode erspan: Always fill in vlan_id
authorMax Fillinger <maximilian.fillinger@fox-it.com>
Mon, 8 Jul 2019 14:51:46 +0000 (16:51 +0200)
committerMax Fillinger <maximilian.fillinger@fox-it.com>
Wed, 10 Jul 2019 10:10:22 +0000 (12:10 +0200)
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
src/decode.c
src/decode.h
src/suricata.c

index 53f43fa24044a55307f700385fce3d3dea136332..21aa3bf40f3b21acad6a421392305951e00921a6 100644 (file)
@@ -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;
index 48af810deead1ede6f3365253686d55150b02b19..f0f793f81ccd67a4eeeff666b9526939a6203d19 100644 (file)
@@ -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;
 }
 
index 6cb54c01fefaf5dcbc1d7c9e4ac6ba32052c6791..4488c0551142b5ff4a7434c01d5595ef9d24cb04 100644 (file)
@@ -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;
index 49eadee5e52181fc60808da3a9651b9727a769a3..dc4843b1fa768ca4ece757325dbf573134efaa50 100644 (file)
@@ -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);