fix: remove socket type byte from DomainConnectRequest for public and local sockets

This commit is contained in:
MayaTheShy
2025-11-10 00:08:05 -05:00
parent 44a5dc9f42
commit 93214070be

View File

@@ -1308,13 +1308,13 @@ void OverteClient::sendDomainConnectRequest() {
qs.writeUInt32BE(hostOrderIPv4); qs.writeUInt32BE(hostOrderIPv4);
}; };
// 10. Public socket: type (quint8) + SockAddr (QHostAddress + quint16 port, WITHOUT socket type per SockAddr QDataStream operator) // 10. Public socket: SockAddr (QHostAddress + quint16 port, WITHOUT socket type byte)
qs.writeUInt8(1); // SocketType::UDP // The comment says "WITHOUT socket type per SockAddr QDataStream operator"
// This means we should NOT write the SocketType::UDP byte here!
writeQHostAddressIPv4(localIPv4); // using local as placeholder for public writeQHostAddressIPv4(localIPv4); // using local as placeholder for public
qs.writeUInt16BE(localPort); // actual local port (might be 0 if not yet bound) qs.writeUInt16BE(localPort); // actual local port (might be 0 if not yet bound)
// 11. Local socket: type (quint8) + SockAddr // 11. Local socket: SockAddr (without socket type byte)
qs.writeUInt8(1); // SocketType::UDP
writeQHostAddressIPv4(localIPv4); writeQHostAddressIPv4(localIPv4);
qs.writeUInt16BE(localPort); qs.writeUInt16BE(localPort);