mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-06-17 14:21:30 +00:00
Fix parsing XOR-MAPPED-ADDRESS if the optional comprehension bit is set
This commit is contained in:
+2
-1
@@ -133,7 +133,8 @@ int LiFindExternalAddressIP4(const char* stunServer, unsigned short stunPort, un
|
|||||||
Limelog("STUN attribute out of bounds: %d\n", htons(attribute->length));
|
Limelog("STUN attribute out of bounds: %d\n", htons(attribute->length));
|
||||||
return -5;
|
return -5;
|
||||||
}
|
}
|
||||||
else if (htons(attribute->type) != STUN_ATTRIBUTE_XOR_MAPPED_ADDRESS) {
|
// Mask off the comprehension bit
|
||||||
|
else if ((htons(attribute->type) & 0x7FFF) != STUN_ATTRIBUTE_XOR_MAPPED_ADDRESS) {
|
||||||
// Continue searching if this wasn't our address
|
// Continue searching if this wasn't our address
|
||||||
bytesRead -= sizeof(*attribute) + htons(attribute->length);
|
bytesRead -= sizeof(*attribute) + htons(attribute->length);
|
||||||
attribute = (PSTUN_ATTRIBUTE_HEADER)(((char*)attribute) + sizeof(*attribute) + htons(attribute->length));
|
attribute = (PSTUN_ATTRIBUTE_HEADER)(((char*)attribute) + sizeof(*attribute) + htons(attribute->length));
|
||||||
|
|||||||
Reference in New Issue
Block a user