temp sync broken

This commit is contained in:
2025-12-30 08:04:26 +01:00
parent 31dda62474
commit 3b2ec32532
27 changed files with 1339 additions and 589 deletions

View File

@@ -105,10 +105,10 @@ void printAnonRequest (const AnonymousRequestPayload *req, int isRoomServer) {
printf (" sync timestamp: %u\n", syncTimestamp);
}
// remaining bytes = password
if (index < req->payloadLen) {
uint8_t passwordLen = req->payloadLen - index;
uint8_t passwordLen = req->payloadLen - index;
if (passwordLen > 16)
passwordLen = 16;
passwordLen = strnlen (&(req->payload[index]), passwordLen);
@@ -175,8 +175,10 @@ void decodeAnonReq (const FrameStruct *frame) {
printAnonRequest (&anonReq, persistent.nodeType == NODE_TYPE_ROOM_SERVER);
uint8_t passwordLen = anonReq.payloadLen - index2;
if (passwordLen > 16)
if (passwordLen > 16) {
passwordLen = 16;
}
passwordLen = strnlen (&(anonReq.payload[index2]), passwordLen);
MESH_LOGI (TAG, "Password len is %d.", passwordLen);
@@ -206,5 +208,9 @@ void decodeAnonReq (const FrameStruct *frame) {
resp.data[index3++] = (randOut >> 24) & 0xFF;
resp.data[index3++] = FIRMWARE_VER_LEVEL;
resp.dataLen = index3;
if ((frame->header & ROUTE_TYPE_MASK) == ROUTE_TYPE_FLOOD ||
(frame->header & ROUTE_TYPE_MASK) == ROUTE_TYPE_TRANSPORT_FLOOD) {
sendPathBack (foundNode, &(frame->path));
}
sendEncryptedResponse (foundNode, &resp);
}