From 97a8f861900b6b59af35dcabd30e8b15a795635c Mon Sep 17 00:00:00 2001 From: Aaron Sinclair Date: Fri, 19 Mar 2021 21:46:07 +0000 Subject: [PATCH] Emit the packet after calculating TCP checksum This should be the same as the UDP checksum, otherwise calculating the TCP checksum results in all packets being discarded. --- core/modules/l4_checksum.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/modules/l4_checksum.cc b/core/modules/l4_checksum.cc index 3ad1f23d6..e24728dc7 100644 --- a/core/modules/l4_checksum.cc +++ b/core/modules/l4_checksum.cc @@ -76,8 +76,10 @@ void L4Checksum::ProcessBatch(Context *ctx, bess::PacketBatch *batch) { if (verify_) EmitPacket(ctx, batch->pkts()[i], (VerifyIpv4TcpChecksum(*ip, *tcp)) ? FORWARD_GATE : FAIL_GATE); - else - tcp->checksum = CalculateIpv4TcpChecksum(*ip, *tcp); + else { + tcp->checksum = CalculateIpv4TcpChecksum(*ip, *tcp); + EmitPacket(ctx, batch->pkts()[i], FORWARD_GATE); + } } } }