mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-14 03:52:39 -04:00
Improvements to BanPeer Code, mainly from a UdpStunner perspective.
* Added UdpStunner::dropStunPeer() code to remove bad peer from stun list. * added calls to UdpStunner::dropStunPeer for BanLists going to/from DHT. * added DEBUG_BANLIST_CONDENSE to remove unnecessary debug. * Improved UdpStunner::status() print out of stunlist. * Added extra check to throw away stun reports where remote_addr == reported ext_addr. - This was causing peers to get the wrong IP addresses. * Modified UdpStunner ExtAddr checks to make sure the IP addresses match. * Changed BANLIST service Id to from Test ID to real ID. NOTE: These are stop-gap methods to avoid the wrong Stun reports. A more robust scheme must be implemented. I'd expect that it would involve a strict initial check to establish your IP address... (e.g. require 4 peers to confirm it, allowing for some fake entries) After this we can have a weaker check ensuring IP address matches. If we detect a likely REAL change of IP address - drop back to requiring a strick check again. git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-dhtmods@4717 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
b6dbdf9396
commit
2048bb5e47
6 changed files with 139 additions and 18 deletions
|
@ -94,6 +94,8 @@ int releaseExclusiveMode(std::string holder, bool forceStun);
|
|||
|
||||
void setTargetStunPeriod(int32_t sec_per_stun);
|
||||
bool addStunPeer(const struct sockaddr_in &remote, const char *peerid);
|
||||
bool dropStunPeer(const struct sockaddr_in &remote);
|
||||
|
||||
bool getStunPeer(int idx, std::string &id,
|
||||
struct sockaddr_in &remote, struct sockaddr_in &eaddr,
|
||||
uint32_t &failCount, time_t &lastSend);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue