From 1fb7c0dddc97b20c0ac03d6810f4e76bce523a57 Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Tue, 4 Feb 2014 11:49:42 +0100 Subject: [PATCH] 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. --- src/source-af-packet.c | 5 +++++ 1 file changed, 5 insertions(+) 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: -- 2.47.3