Only send redirects to the sending InetAddress and only in response to a set of certain frame types to avoid potential race conditions.

This commit is contained in:
Adam Ierymenko 2015-10-26 17:58:51 -07:00
parent 8bfb02ba3c
commit 98d856daa2
3 changed files with 62 additions and 59 deletions

View file

@ -247,12 +247,13 @@ public:
/**
* Redirect this peer to a better cluster member if needed
*
* @param peerAddress Peer to (possibly) redirect
* @param peer Peer to (possibly) redirect
* @param localAddress Local address for path or NULL for none/any
* @param peerPhysicalAddress Physical address of peer's current best path (where packet was most recently received or getBestPath()->address())
* @param offload Always redirect if possible -- can be used to offload peers during shutdown
* @return True if peer was redirected
*/
bool redirectPeer(const Address &peerAddress,const InetAddress &peerPhysicalAddress,bool offload);
bool redirectPeer(const SharedPtr<Peer> &peer,const InetAddress &localAddress,const InetAddress &peerPhysicalAddress,bool offload);
/**
* Fill out ZT_ClusterStatus structure (from core API)