Fix flaky fragment reassembly.

Fragmented packets need to be handled by the same processor goroutine.

PiperOrigin-RevId: 635529020
This commit is contained in:
Lucas Manning
2024-05-20 12:05:33 -07:00
committed by gVisor bot
parent f9d4d51c7e
commit 9401ec1190
+6 -2
View File
@@ -193,8 +193,12 @@ func tcpipConnectionID(pkt *stack.PacketBuffer) (connectionID, bool) {
cid.srcAddr = ipHdr.SourceAddressSlice()
cid.dstAddr = ipHdr.DestinationAddressSlice()
cid.srcPort = tcpHdr.SourcePort()
cid.dstPort = tcpHdr.DestinationPort()
// All fragment packets need to be processed by the same goroutine, so
// only record the TCP ports if this is not a fragment packet.
if ipHdr.IsValid(pkt.Data().Size()) && !ipHdr.More() && ipHdr.FragmentOffset() == 0 {
cid.srcPort = tcpHdr.SourcePort()
cid.dstPort = tcpHdr.DestinationPort()
}
cid.proto = header.IPv4ProtocolNumber
case header.IPv6Version:
h, ok = pkt.Data().PullUp(header.IPv6FixedHeaderSize + tcpSrcDstPortLen)