diff options
Diffstat (limited to 'core/DHT.c')
-rw-r--r-- | core/DHT.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -492,7 +492,7 @@ int sendnodes(IP_Port ip_port, char * client_id, uint32_t ping_id) | |||
492 | 492 | ||
493 | //Packet handling functions | 493 | //Packet handling functions |
494 | //One to handle each types of packets we recieve | 494 | //One to handle each types of packets we recieve |
495 | 495 | //return 0 if handled correctly, 1 if packet is bad. | |
496 | int handle_pingreq(char * packet, uint32_t length, IP_Port source)//tested | 496 | int handle_pingreq(char * packet, uint32_t length, IP_Port source)//tested |
497 | { | 497 | { |
498 | if(length != 5 + CLIENT_ID_SIZE) | 498 | if(length != 5 + CLIENT_ID_SIZE) |
@@ -561,7 +561,7 @@ int handle_getnodes(char * packet, uint32_t length, IP_Port source) | |||
561 | 561 | ||
562 | int handle_sendnodes(char * packet, uint32_t length, IP_Port source)//tested | 562 | int handle_sendnodes(char * packet, uint32_t length, IP_Port source)//tested |
563 | { | 563 | { |
564 | if(length > (5 + CLIENT_ID_SIZE + MAX_SENT_NODES * (CLIENT_ID_SIZE + sizeof(IP_Port))) || | 564 | if(length > (5 + CLIENT_ID_SIZE + MAX_SENT_NODES * (CLIENT_ID_SIZE + sizeof(IP_Port))) || |
565 | (length - 5 - CLIENT_ID_SIZE) % (CLIENT_ID_SIZE + sizeof(IP_Port)) != 0) | 565 | (length - 5 - CLIENT_ID_SIZE) % (CLIENT_ID_SIZE + sizeof(IP_Port)) != 0) |
566 | { | 566 | { |
567 | return 1; | 567 | return 1; |