Repository navigation
Conversation
| if !skippedPacket { | ||
| return packet | ||
| } | ||
| } |
There was a problem hiding this comment.
I understand needing to claim the frame we did not open, but do we need to do this loop above? Can we let it signal to the out loops in handleInbound that we need to continueProcessing?
There was a problem hiding this comment.
I prototyped what you said, ran the tests, they pass, your suggestion is better than current state; out loop in handleInbound already iterates coalesced packets. Letting parse report the skip and have existing loop take the next packet seems to simplify things yea.
At the same time, outer loop bumps the idle and keep alive timestamps after every packet that returns "continue". A skipped packet must not bump it. RFC 9000 Section 10.1 restarts the idle timer on a packet that was successfully processed and today an undecryptable packet doesnt bump it. Without a guard, anyone who knows the connection DCID could keep the connection from idling out by sending a dead initial with one trailing byte. The prototype guards that with one if, ill push that patch shortly
965c72c to
8de98b7
Compare
| coalesced: coalesced, | ||
| isServerConnection: isServerConnection, | ||
| packetParser: &packetParser, | ||
| skippedPacket: &skippedPacket, |
There was a problem hiding this comment.
Do we even need skippedPacket here then?
There was a problem hiding this comment.
Not the inout, no. The loop still needs to tell "skipped" from "processed" so it doesnt refresh lastPacketReceivedTimestamp on a packet it couldn't open (RFC 9000 10.1 only restarts the idle timer on a successfully processed packet).
I've changed handleInboundPacket to return .processed / .skipped / .stop instead of Bool plus a flag, so this call site reads one value; the flag only lives between the parser and handleInboundPacket now; change in b78aeb8 now
- A long-header packet whose keys are not installed, or were already discarded, ended processing of the whole datagram, so a packet coalesced after it was dropped. RFC 9000 Section 12.2 requires the remaining packets to be processed - PacketParser.parse now steps over such a packet using the length in its header and reports the skip, so QUICConnection.handleInbound goes on to the next coalesced packet without restarting the idle timer. A packet that has keys but fails decryption still ends the datagram, as before - Add tests that deliver an Initial packet followed by a 1-RTT packet in one datagram after both ends discarded their Initial keys
8de98b7 to
b78aeb8
Compare
When a datagram carries several QUIC packets and we can't decrypt one of them because its keys are gone or not installed yet, we drop everything after it. RFC 9000 Section 12.2 says the remaining packets must still be processed.
PacketParser.parsenow skips such a packet using the Length in its long header and carries on with the rest of the datagram.