fix: enhance debug output for local ID in handleDomainListReply
This commit is contained in:
@@ -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!
|
// Read domain local ID (16-bit) - this is in LITTLE-ENDIAN, not big-endian!
|
||||||
// Do NOT use ntohs() - just read directly on x86
|
// Do NOT use ntohs() - just read directly on x86
|
||||||
if (offset + 2 > len) return;
|
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;
|
uint16_t localID;
|
||||||
std::memcpy(&localID, data + offset, sizeof(uint16_t)); // Direct read, little-endian
|
std::memcpy(&localID, data + offset, sizeof(uint16_t)); // Direct read, little-endian
|
||||||
offset += 2;
|
offset += 2;
|
||||||
@@ -962,7 +968,7 @@ void OverteClient::handleDomainListReply(const char* data, size_t len) {
|
|||||||
// Store our local ID for use in sourced packets
|
// Store our local ID for use in sourced packets
|
||||||
m_localID = localID;
|
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)
|
// Read permissions (32-bit)
|
||||||
if (offset + 4 > len) return;
|
if (offset + 4 > len) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user