mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-03-10 22:44:21 +00:00
Fix TRACE bug and new UDP socket code issue.
This commit is contained in:
parent
15e8c18106
commit
4d0ad9abb6
@ -609,7 +609,7 @@ bool PacketDecoder::_doMULTICAST_FRAME(const RuntimeEnvironment *_r,const Shared
|
|||||||
maxDepth = ZT_MULTICAST_GLOBAL_MAX_DEPTH;
|
maxDepth = ZT_MULTICAST_GLOBAL_MAX_DEPTH;
|
||||||
|
|
||||||
if (!network->isAllowed(origin)) {
|
if (!network->isAllowed(origin)) {
|
||||||
TRACE("didn't inject MULTICAST_FRAME from %s(%s) into %.16llx: sender %s not allowed or we don't have a certificate",source().toString().c_str(),nwid,_remoteAddress.toString().c_str(),origin.toString().c_str());
|
TRACE("didn't inject MULTICAST_FRAME from %s(%s) into %.16llx: sender %s not allowed or we don't have a certificate",source().toString().c_str(),_remoteAddress.toString().c_str(),nwid,origin.toString().c_str());
|
||||||
|
|
||||||
// Tell them we need a certificate
|
// Tell them we need a certificate
|
||||||
Packet outp(source(),_r->identity.address(),Packet::VERB_ERROR);
|
Packet outp(source(),_r->identity.address(),Packet::VERB_ERROR);
|
||||||
|
@ -422,10 +422,12 @@ void SocketManager::poll(unsigned long timeout)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((_udpV4Socket)&&(FD_ISSET(_udpV4Socket->_sock,&rfds)))
|
if ((_udpV4Socket)&&(FD_ISSET(_udpV4Socket->_sock,&rfds))) {
|
||||||
_udpV4Socket->notifyAvailableForRead(_udpV4Socket,this);
|
_udpV4Socket->notifyAvailableForRead(_udpV4Socket,this);
|
||||||
if ((_udpV6Socket)&&(FD_ISSET(_udpV6Socket->_sock,&rfds)))
|
}
|
||||||
|
if ((_udpV6Socket)&&(FD_ISSET(_udpV6Socket->_sock,&rfds))) {
|
||||||
_udpV6Socket->notifyAvailableForRead(_udpV6Socket,this);
|
_udpV6Socket->notifyAvailableForRead(_udpV6Socket,this);
|
||||||
|
}
|
||||||
|
|
||||||
bool closedSockets = false;
|
bool closedSockets = false;
|
||||||
{ // grab copy of TCP sockets list because _tcpSockets[] might be changed in a handler
|
{ // grab copy of TCP sockets list because _tcpSockets[] might be changed in a handler
|
||||||
|
@ -93,13 +93,11 @@ bool UdpSocket::notifyAvailableForRead(const SharedPtr<Socket> &self,SocketManag
|
|||||||
{
|
{
|
||||||
Buffer<ZT_SOCKET_MAX_MESSAGE_LEN> buf;
|
Buffer<ZT_SOCKET_MAX_MESSAGE_LEN> buf;
|
||||||
InetAddress from;
|
InetAddress from;
|
||||||
for(;;) {
|
|
||||||
socklen_t salen = from.saddrSpaceLen();
|
socklen_t salen = from.saddrSpaceLen();
|
||||||
int n = (int)recvfrom(_sock,buf.data(),ZT_SOCKET_MAX_MESSAGE_LEN,0,from.saddr(),&salen);
|
int n = (int)recvfrom(_sock,buf.data(),ZT_SOCKET_MAX_MESSAGE_LEN,0,from.saddr(),&salen);
|
||||||
if (n > 0) {
|
if (n > 0) {
|
||||||
buf.setSize((unsigned int)n);
|
buf.setSize((unsigned int)n);
|
||||||
sm->handleReceivedPacket(self,from,buf);
|
sm->handleReceivedPacket(self,from,buf);
|
||||||
} else break;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user