Official eMule-Board: Kad Tcp Firewall Test - Official eMule-Board

Jump to content


Page 1 of 1

Kad Tcp Firewall Test what if the client is known and LowID?

#1 User is offline   Enig123 

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

Posted 28 December 2015 - 07:25 PM

When a remote client request TCP firewall test via kad, if this particular client is known as a LowID client, it wont work as intended.
			case KS_QUEUED_FWCHECK:
			case KS_QUEUED_FWCHECK_UDP:
				//Another client asked us to try to connect to them to check their firewalled status.
				cur_client->TryToConnect(true, true);
				break;

where TryToConnect directly to a LowID client will always fail.

My question is, should we check if the found existing client is known as LowID and failed the test, or we can re-set the ConnectingIP and the TCP port and do the test if the client is not TCP connected with us?

bool CClientList::RequestTCP(Kademlia::CContact* contact, uint8 byConnectOptions)
{
	uint32 nContactIP = ntohl(contact->GetIPAddress());
	// don't connect ourself
	if (theApp.serverconnect->GetLocalIP() == nContactIP && thePrefs.GetPort() == contact->GetTCPPort())
		return false;

	CUpDownClient* pNewClient = FindClientByIP(nContactIP, contact->GetTCPPort());

	if (!pNewClient)
		pNewClient = new CUpDownClient(0, contact->GetTCPPort(), contact->GetIPAddress(), 0, 0, false );
	else if (pNewClient->GetKadState() != KS_NONE)
		return false; // already busy with this client in some way (probably buddy stuff), don't mess with it
	else if (pNewClient->HasLowID()) //<<- Enig123
		return false; //<<- Enig123: the client is known as LowID, TryToConnect to it will always fail

or we can re-set the ID and the TCP port of this client, like initializing a new client from scratch, I am not sure how to do it in the correct way though.

Any thoughts?

Oh, I'm not sure if this should be put into kad specific category, if it does belong to that, please administrators move it there.

Regards,
Enig123

This post has been edited by Enig123: 28 December 2015 - 07:26 PM

0

#2 User is offline   fox88 

  • Golden eMule
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 4974
  • Joined: 13-May 07

Posted 28 December 2015 - 08:56 PM

At random point in time port could get opened or closed because of changed network condition or user actions.
Therefore such ID checks should be done as new.
0

  • Member Options

Page 1 of 1

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