Do not replace connection ID for unknown versions This prevents the QUIC_BUG from b/139661722 from firing. gfe-relnote: avoid a GFE_BUG when parsing a specific invalid packet Startblock: after 2019-09-24 08:00 in US/Pacific PiperOrigin-RevId: 270909914 Change-Id: Idbeb2ee5c02c6d011d0696ad1cfb4aa64547fcb9
diff --git a/quic/core/quic_dispatcher.cc b/quic/core/quic_dispatcher.cc index 4d7a2d7..b130fe9 100644 --- a/quic/core/quic_dispatcher.cc +++ b/quic/core/quic_dispatcher.cc
@@ -401,8 +401,14 @@ it->second->ProcessUdpPacket(packet_info.self_address, packet_info.peer_address, packet_info.packet); return true; - } else { + } else if (packet_info.version.transport_version != + QUIC_VERSION_UNSUPPORTED) { // We did not find the connection ID, check if we've replaced it. + // This is only performed for supported versions because packets with + // unsupported versions can flow through this function in order to send + // a version negotiation packet, but we know that their connection ID + // did not get replaced since that is performed on connection creation, + // and that only happens for known verions. QuicConnectionId replaced_connection_id = MaybeReplaceServerConnectionId( server_connection_id, packet_info.version); if (replaced_connection_id != server_connection_id) {