Certificate of membership works now... had to fix multicast propagation so COM is pushed with multicast, which makes tremendous sense in retrospect.

This commit is contained in:
Adam Ierymenko 2013-10-25 14:51:55 -04:00
parent 010616e3ae
commit 942cc0ca21
4 changed files with 33 additions and 44 deletions

View file

@ -207,32 +207,6 @@ public:
_pushMembershipCertificate(peer,force,now);
}
/**
* Push membership certificate to a packed zero-terminated array of addresses
*
* This pushes to all peers in peers[] (length must be a multiple of 5) until
* len is reached or a null address is encountered.
*
* @param peers Packed array of 5-byte big-endian addresses
* @param len Length of peers[] in total (bytes, not addresses)
* @param force If true, push even if we've already done so within required time frame
* @param now Current time
*/
inline void pushMembershipCertificate(const void *peers,unsigned int len,bool force,uint64_t now)
{
Mutex::Lock _l(_lock);
if ((_config)&&(!_config->isOpen())&&(_config->com())) {
for(unsigned int i=0;i<len;i+=ZT_ADDRESS_LENGTH) {
if ((i + ZT_ADDRESS_LENGTH) > len)
break;
Address a((char *)peers + i,ZT_ADDRESS_LENGTH);
if (a)
_pushMembershipCertificate(a,force,now);
else break;
}
}
}
/**
* @param peer Peer address to check
* @return True if peer is allowed to communicate on this network