|
|
|
@ -948,7 +948,7 @@ static int AFPReadFromRing(AFPThreadVars *ptv)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* get vlan id from header */
|
|
|
|
|
if ((!(ptv->flags & AFP_VLAN_DISABLED)) &&
|
|
|
|
|
if ((ptv->flags & AFP_VLAN_IN_HEADER) &&
|
|
|
|
|
(h.h2->tp_status & TP_STATUS_VLAN_VALID || h.h2->tp_vlan_tci)) {
|
|
|
|
|
p->vlan_id[0] = h.h2->tp_vlan_tci & 0x0fff;
|
|
|
|
|
p->vlan_idx = 1;
|
|
|
|
@ -1071,7 +1071,7 @@ static inline int AFPParsePacketV3(AFPThreadVars *ptv, struct tpacket_block_desc
|
|
|
|
|
p->livedev = ptv->livedev;
|
|
|
|
|
p->datalink = ptv->datalink;
|
|
|
|
|
|
|
|
|
|
if ((!(ptv->flags & AFP_VLAN_DISABLED)) &&
|
|
|
|
|
if ((ptv->flags & AFP_VLAN_IN_HEADER) &&
|
|
|
|
|
(ppd->tp_status & TP_STATUS_VLAN_VALID || ppd->hv1.tp_vlan_tci)) {
|
|
|
|
|
p->vlan_id[0] = ppd->hv1.tp_vlan_tci & 0x0fff;
|
|
|
|
|
p->vlan_idx = 1;
|
|
|
|
@ -2807,19 +2807,11 @@ TmEcode ReceiveAFPThreadInit(ThreadVars *tv, const void *initdata, void **data)
|
|
|
|
|
|
|
|
|
|
afpconfig->DerefFunc(afpconfig);
|
|
|
|
|
|
|
|
|
|
/* A bit strange to have this here but we only have vlan information
|
|
|
|
|
* during reading so we need to know if we want to keep vlan during
|
|
|
|
|
* the capture phase */
|
|
|
|
|
int vlanbool = 0;
|
|
|
|
|
if ((ConfGetBool("vlan.use-for-tracking", &vlanbool)) == 1 && vlanbool == 0) {
|
|
|
|
|
ptv->flags |= AFP_VLAN_DISABLED;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If kernel is older than 3.0, VLAN is not stripped so we don't
|
|
|
|
|
* get the info from packet extended header but we will use a standard
|
|
|
|
|
* parsing of packet data (See Linux commit bcc6d47903612c3861201cc3a866fb604f26b8b2) */
|
|
|
|
|
if (! SCKernelVersionIsAtLeast(3, 0)) {
|
|
|
|
|
ptv->flags |= AFP_VLAN_DISABLED;
|
|
|
|
|
if (SCKernelVersionIsAtLeast(3, 0)) {
|
|
|
|
|
ptv->flags |= AFP_VLAN_IN_HEADER;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SCReturnInt(TM_ECODE_OK);
|
|
|
|
|