From 5dc46ae7c70028280c3be2d96aa71049142aa001 Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Tue, 20 Dec 2011 15:10:57 +0100 Subject: [PATCH] pf-ring: Mark emitted traffic as non checksummed The traffic sent by an interface is potentially offloaded. This patch adds detection of TX packets and set the corresponding flag. --- src/source-pfring.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/source-pfring.c b/src/source-pfring.c index 4611bca214..7160aeec13 100644 --- a/src/source-pfring.c +++ b/src/source-pfring.c @@ -182,6 +182,12 @@ static inline void PfringProcessPacket(void *user, struct pfring_pkthdr *h, Pack * so that is what we do here. */ p->datalink = LINKTYPE_ETHERNET; + /* Packet is being sent */ + if (h->extended_hdr.rx_direction == 0) { + /* Checksum can be offloaded */ + p->flags |= PKT_IGNORE_CHECKSUM; + } + SET_PKT_LEN(p, h->caplen); }