]> git.kaiwu.me - nginx.git/commit
QUIC: ignore duplicate PATH_CHALLENGE frames.
authorRoman Arutyunyan <arut@nginx.com>
Wed, 22 Nov 2023 10:48:12 +0000 (14:48 +0400)
committerRoman Arutyunyan <arut@nginx.com>
Wed, 22 Nov 2023 10:48:12 +0000 (14:48 +0400)
commit0c0f3405544404b354780ddbeacf5d54f122bcdc
tree81a730c0f20cca4c9578a1e20482c12c62f7bccd
parent6c78bb9bb1ccbf91f5f059c13a82badea529012a
QUIC: ignore duplicate PATH_CHALLENGE frames.

According to RFC 9000, an endpoint SHOULD NOT send multiple PATH_CHALLENGE
frames in a single packet.  The change adds a check to enforce this claim to
optimize server behavior.  Previously each PATH_CHALLENGE always resulted in a
single response datagram being sent to client.  The effect of this was however
limited by QUIC flood protection.

Also, PATH_CHALLENGE is explicitly disabled in Initial and Handshake levels,
see RFC 9000, Table 3.  However, technically it may be sent by client in 0-RTT
over a new path without actual migration, even though the migration itself is
prohibited during handshake.  This allows client to coalesce multiple 0-RTT
packets each carrying a PATH_CHALLENGE and end up with multiple PATH_CHALLENGEs
per datagram.  This again leads to suboptimal behavior, see above.  Since the
purpose of sending PATH_CHALLENGE frames in 0-RTT is unclear, these frames are
now only allowed in 1-RTT.  For 0-RTT they are silently ignored.
src/event/quic/ngx_event_quic_migration.c
src/event/quic/ngx_event_quic_transport.h