Fix condition checking for Initial packet
The code previously determined whether a packet was an Initial packet by looking at its type value, without first checking it was not a Version Negotiation packet. In the case of a Version Negotiation packet, reading the type value returned the random value in the Unused field. This occasionally caused Version Negotiation packets to be misinterpreted as Initial packets. When this happened, ngtcp2_conn_read_pkt() returned NGTCP2_ERR_DRAINING instead of NGTCP2_ERR_RECV_VERSION_NEGOTIATION.
Please register or sign in to comment