|
@@ -58,7 +58,7 @@ uint32_t Address_prefixForSearchTarget(const uint8_t searchTarget[16])
|
|
|
void Address_serialize(uint8_t output[Address_SERIALIZED_SIZE], const struct Address* addr)
|
|
|
{
|
|
|
Bits_memcpy(output, addr->key, Address_KEY_SIZE);
|
|
|
- Bits_memcpy(output+Address_KEY_SIZE, &addr->path, 8);
|
|
|
+ Bits_memcpy(output+Address_KEY_SIZE, &addr->path, sizeof(addr->path));
|
|
|
if (!Endian_isBigEndian()) {
|
|
|
uint64_t path_be = Endian_hostToBigEndian64(addr->path);
|
|
|
Bits_memcpy(output + Address_KEY_SIZE, &path_be, Address_NETWORK_ADDR_SIZE);
|
|
@@ -69,7 +69,7 @@ void Address_parse(struct Address* addr, const uint8_t input[Address_SERIALIZED_
|
|
|
{
|
|
|
Bits_memset(addr->ip6.bytes, 0, 16);
|
|
|
Bits_memcpy(addr->key, input, Address_KEY_SIZE);
|
|
|
- Bits_memcpy(&addr->path, input+Address_KEY_SIZE, 8);
|
|
|
+ Bits_memcpy(&addr->path, input+Address_KEY_SIZE, sizeof(addr->path));
|
|
|
addr->path = Endian_bigEndianToHost64(addr->path);
|
|
|
}
|
|
|
|