diff options
Diffstat (limited to 'toxcore/DHT.c')
-rw-r--r-- | toxcore/DHT.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/toxcore/DHT.c b/toxcore/DHT.c index 749eb78c..4807c369 100644 --- a/toxcore/DHT.c +++ b/toxcore/DHT.c | |||
@@ -483,12 +483,12 @@ static int getnodes(DHT *dht, IP_Port ip_port, uint8_t *public_key, uint8_t *cli | |||
483 | { | 483 | { |
484 | /* Check if packet is going to be sent to ourself. */ | 484 | /* Check if packet is going to be sent to ourself. */ |
485 | if (id_equal(public_key, dht->c->self_public_key) || is_gettingnodes(dht, ip_port, 0)) | 485 | if (id_equal(public_key, dht->c->self_public_key) || is_gettingnodes(dht, ip_port, 0)) |
486 | return 1; | 486 | return -1; |
487 | 487 | ||
488 | uint64_t ping_id = add_gettingnodes(dht, ip_port); | 488 | uint64_t ping_id = add_gettingnodes(dht, ip_port); |
489 | 489 | ||
490 | if (ping_id == 0) | 490 | if (ping_id == 0) |
491 | return 1; | 491 | return -1; |
492 | 492 | ||
493 | uint8_t data[1 + CLIENT_ID_SIZE + crypto_box_NONCEBYTES + sizeof(ping_id) + CLIENT_ID_SIZE + ENCRYPTION_PADDING]; | 493 | uint8_t data[1 + CLIENT_ID_SIZE + crypto_box_NONCEBYTES + sizeof(ping_id) + CLIENT_ID_SIZE + ENCRYPTION_PADDING]; |
494 | uint8_t plain[sizeof(ping_id) + CLIENT_ID_SIZE]; | 494 | uint8_t plain[sizeof(ping_id) + CLIENT_ID_SIZE]; |
@@ -522,7 +522,7 @@ static int sendnodes(DHT *dht, IP_Port ip_port, uint8_t *public_key, uint8_t *cl | |||
522 | { | 522 | { |
523 | /* Check if packet is going to be sent to ourself. */ | 523 | /* Check if packet is going to be sent to ourself. */ |
524 | if (id_equal(public_key, dht->c->self_public_key)) | 524 | if (id_equal(public_key, dht->c->self_public_key)) |
525 | return 1; | 525 | return -1; |
526 | 526 | ||
527 | uint8_t data[1 + CLIENT_ID_SIZE + crypto_box_NONCEBYTES + sizeof(ping_id) | 527 | uint8_t data[1 + CLIENT_ID_SIZE + crypto_box_NONCEBYTES + sizeof(ping_id) |
528 | + sizeof(Node_format) * MAX_SENT_NODES + ENCRYPTION_PADDING]; | 528 | + sizeof(Node_format) * MAX_SENT_NODES + ENCRYPTION_PADDING]; |