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.
pull/4016/head
Max Fillinger 6 years ago
parent 8d3b04b0e3
commit 44bea80d3c

@ -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;

@ -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;
}

@ -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;

@ -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);

Loading…
Cancel
Save