handle types larger than 255 for packetVersionAndHashMatch

This commit is contained in:
Stephen Birarda 2014-05-20 15:45:08 -07:00
parent b42e005cdb
commit 13077e48f8

View file

@ -152,10 +152,11 @@ void LimitedNodeList::changeSendSocketBufferSize(int numSendBytes) {
bool LimitedNodeList::packetVersionAndHashMatch(const QByteArray& packet) {
PacketType checkType = packetTypeForPacket(packet);
if (packet[1] != versionForPacketType(checkType)
int numPacketTypeBytes = numBytesArithmeticCodingFromBuffer(packet.data());
if (packet[numPacketTypeBytes] != versionForPacketType(checkType)
&& checkType != PacketTypeStunResponse) {
PacketType mismatchType = packetTypeForPacket(packet);
int numPacketTypeBytes = numBytesArithmeticCodingFromBuffer(packet.data());
static QMultiMap<QUuid, PacketType> versionDebugSuppressMap;