mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Changed handshake code to use union IP_Port.
This commit is contained in:
parent
d2d1af2ce9
commit
8d71f67a72
|
@ -62,10 +62,10 @@ static uint32_t handshake_id(Lossless_UDP *ludp, IP_Port source)
|
|||
uint32_t id = 0, i;
|
||||
|
||||
for (i = 0; i < 6; ++i) {
|
||||
if (ludp->randtable[i][((uint8_t *)&source)[i]] == 0)
|
||||
ludp->randtable[i][((uint8_t *)&source)[i]] = random_int();
|
||||
if (ludp->randtable[i][source.uint8[i]] == 0)
|
||||
ludp->randtable[i][source.uint8[i]] = random_int();
|
||||
|
||||
id ^= ludp->randtable[i][((uint8_t *)&source)[i]];
|
||||
id ^= ludp->randtable[i][source.uint8[i]];
|
||||
}
|
||||
|
||||
/* id can't be zero. */
|
||||
|
|
Loading…
Reference in New Issue
Block a user