diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-01-14 21:08:02 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-01-14 21:08:02 +0000 |
commit | da739a9438bab75b1ad18cb96208069895b88d2b (patch) | |
tree | 75f1dbb6d7c08264e27a58d0b2ad97839aa414f3 /toxcore/DHT.c | |
parent | d79b15c52daf82748040f41f93fa6e046efdeee7 (diff) |
Add random_u16 function and rename the others to match.
Diffstat (limited to 'toxcore/DHT.c')
-rw-r--r-- | toxcore/DHT.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/toxcore/DHT.c b/toxcore/DHT.c index 4e089180..8eaf7a4d 100644 --- a/toxcore/DHT.c +++ b/toxcore/DHT.c | |||
@@ -1454,7 +1454,7 @@ int DHT_addfriend(DHT *dht, const uint8_t *public_key, void (*ip_callback)(void | |||
1454 | memset(dht_friend, 0, sizeof(DHT_Friend)); | 1454 | memset(dht_friend, 0, sizeof(DHT_Friend)); |
1455 | memcpy(dht_friend->public_key, public_key, CRYPTO_PUBLIC_KEY_SIZE); | 1455 | memcpy(dht_friend->public_key, public_key, CRYPTO_PUBLIC_KEY_SIZE); |
1456 | 1456 | ||
1457 | dht_friend->nat.NATping_id = random_64b(); | 1457 | dht_friend->nat.NATping_id = random_u64(); |
1458 | ++dht->num_friends; | 1458 | ++dht->num_friends; |
1459 | 1459 | ||
1460 | lock_num = dht_friend->lock_count; | 1460 | lock_num = dht_friend->lock_count; |
@@ -1985,7 +1985,7 @@ static int handle_NATping(void *object, IP_Port source, const uint8_t *source_pu | |||
1985 | 1985 | ||
1986 | if (packet[0] == NAT_PING_RESPONSE) { | 1986 | if (packet[0] == NAT_PING_RESPONSE) { |
1987 | if (dht_friend->nat.NATping_id == ping_id) { | 1987 | if (dht_friend->nat.NATping_id == ping_id) { |
1988 | dht_friend->nat.NATping_id = random_64b(); | 1988 | dht_friend->nat.NATping_id = random_u64(); |
1989 | dht_friend->nat.hole_punching = 1; | 1989 | dht_friend->nat.hole_punching = 1; |
1990 | return 0; | 1990 | return 0; |
1991 | } | 1991 | } |