diff --git a/src/OverteClient.cpp b/src/OverteClient.cpp index 1783d5d..9e6ba29 100644 --- a/src/OverteClient.cpp +++ b/src/OverteClient.cpp @@ -955,6 +955,12 @@ void OverteClient::handleDomainListReply(const char* data, size_t len) { // Read domain local ID (16-bit) - this is in LITTLE-ENDIAN, not big-endian! // Do NOT use ntohs() - just read directly on x86 if (offset + 2 > len) return; + + // Debug: show the exact bytes at this position + std::cout << "[OverteClient] LocalID bytes at offset " << offset << ": " + << std::hex << std::setfill('0') << std::setw(2) << (int)(unsigned char)data[offset] << " " + << std::setw(2) << (int)(unsigned char)data[offset+1] << std::dec << std::endl; + uint16_t localID; std::memcpy(&localID, data + offset, sizeof(uint16_t)); // Direct read, little-endian offset += 2; @@ -962,7 +968,7 @@ void OverteClient::handleDomainListReply(const char* data, size_t len) { // Store our local ID for use in sourced packets m_localID = localID; - std::cout << "[OverteClient] Local ID: " << localID << std::endl; + std::cout << "[OverteClient] Local ID: " << localID << " (0x" << std::hex << localID << std::dec << ")" << std::endl; // Read permissions (32-bit) if (offset + 4 > len) return;