Add missing check for PCP version

This commit is contained in:
Cameron Gutman 2018-11-29 23:57:33 -08:00
parent 8da9936bcf
commit ade084366d

View File

@ -233,6 +233,10 @@ bool PCPMapPort(PSOCKADDR_STORAGE localAddr, int localAddrLen, PSOCKADDR_STORAGE
printf("PCP message truncated: %d\n", bytesRead);
goto fail;
}
else if (resp.hdr.hdr.version != PCP_VERSION) {
printf("PCP version mismatch: %x\n", resp.hdr.hdr.version);
goto fail;
}
else if (resp.hdr.hdr.opcode != OPCODE_MAP_RESPONSE) {
printf("PCP message type mismatch: %x\n", resp.hdr.hdr.opcode);
goto fail;