From: Eric Leblond Date: Tue, 4 Feb 2014 10:49:42 +0000 (+0100) Subject: af-packet: handle vlan counter X-Git-Tag: suricata-2.0rc1~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fb7c0dddc97b20c0ac03d6810f4e76bce523a57;p=thirdparty%2Fsuricata.git af-packet: handle vlan counter This patch adds a vlan counter increment in decodeAFP. This is needed to take into account vlan_id set by the packet reading function. --- diff --git a/src/source-af-packet.c b/src/source-af-packet.c index 63f3a6632e..0a3c5f00ed 100644 --- a/src/source-af-packet.c +++ b/src/source-af-packet.c @@ -1688,6 +1688,11 @@ TmEcode DecodeAFP(ThreadVars *tv, Packet *p, void *data, PacketQueue *pq, Packet SCPerfCounterAddUI64(dtv->counter_avg_pkt_size, tv->sc_perf_pca, GET_PKT_LEN(p)); SCPerfCounterSetUI64(dtv->counter_max_pkt_size, tv->sc_perf_pca, GET_PKT_LEN(p)); + /* If suri has set vlan during reading, we increase vlan counter */ + if (p->vlan_idx) { + SCPerfCounterIncr(dtv->counter_vlan, tv->sc_perf_pca); + } + /* call the decoder */ switch(p->datalink) { case LINKTYPE_LINUX_SLL: