Official eMule-Board: Possible Kademlia Bug With Storefile Handling In Search.cpp? - Official eMule-Board

Jump to content


Page 1 of 1

Possible Kademlia Bug With Storefile Handling In Search.cpp? cliend ID instead client Hash should be sent

#1 User is offline   Enig123 

  • Golden eMule
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 599
  • Joined: 22-November 04

Posted 18 March 2025 - 08:57 AM

In line 635 of kademlia\kademlia\Search.cpp,
			// Get our clientID for the packet.
			CUInt128 uID(CKademlia::GetPrefs()->GetClientHash());

it supposed to be the client ID there, what does client ID mean? Is it client hash or just kad id?

The uID is then used to send a packet in line 694:
			// Send packet
			CKademlia::GetUDPListener()->SendPublishSourcePacket(pFromContact, m_uTarget, uID, listTag);

and the routine is implemented in kademlia\net\KademliaUDPListener.cpp starting with line 190, in which 'KADEMLIA2_PUBLISH_SOURCE_REQ' is sent.

I am a little confused, since other variable naming indicating perhaps GetKadID should be used instead?

This post has been edited by Enig123: 18 March 2025 - 09:06 AM

0

#2 User is offline   Enig123 

  • Golden eMule
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 599
  • Joined: 22-November 04

Posted 19 March 2025 - 06:00 AM

Never mind. Digging into the codes a little deeper today, and I realized the UInt128 here is transferred to remote peer as the ed2k userhash, thus the use of GetClientHash() right here is correct, actually.

I know kademlia has proved its maturity after running efficiently all these years, probably that's why it's so hard to find an unknown bug at this point.
0

  • Member Options

Page 1 of 1

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users