* workaround for TRACE packets so they can follow a return path
This commit is contained in:
@@ -14,6 +14,9 @@ void Packet::calculatePacketHash(uint8_t* hash) const {
|
|||||||
SHA256 sha;
|
SHA256 sha;
|
||||||
uint8_t t = getPayloadType();
|
uint8_t t = getPayloadType();
|
||||||
sha.update(&t, 1);
|
sha.update(&t, 1);
|
||||||
|
if (t == PAYLOAD_TYPE_TRACE) {
|
||||||
|
sha.update(&path_len, sizeof(path_len)); // CAVEAT: TRACE packets can revisit same node on return path
|
||||||
|
}
|
||||||
sha.update(payload, payload_len);
|
sha.update(payload, payload_len);
|
||||||
sha.finalize(hash, MAX_HASH_SIZE);
|
sha.finalize(hash, MAX_HASH_SIZE);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user