Skip to content

Commit 1d73719

Browse files
author
Aaron Sinclair
committed
Emit the packet after calculating TCP checksum
This should be the same as the UDP checksum, otherwise verifying the TCP checksum results in all packets being discarded.
1 parent ae52fc5 commit 1d73719

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

core/modules/l4_checksum.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,10 @@ void L4Checksum::ProcessBatch(Context *ctx, bess::PacketBatch *batch) {
7676
if (verify_)
7777
EmitPacket(ctx, batch->pkts()[i],
7878
(VerifyIpv4TcpChecksum(*ip, *tcp)) ? FORWARD_GATE : FAIL_GATE);
79-
else
80-
tcp->checksum = CalculateIpv4TcpChecksum(*ip, *tcp);
79+
else {
80+
tcp->checksum = CalculateIpv4TcpChecksum(*ip, *tcp);
81+
EmitPacket(ctx, batch->pkts()[i], FORWARD_GATE);
82+
}
8183
}
8284
}
8385
}

0 commit comments

Comments
 (0)