mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 03:53:44 +02:00
Thinko.
This commit is contained in:
parent
bcf8c30ce0
commit
104fade420
1 changed files with 162 additions and 165 deletions
|
@ -273,11 +273,6 @@ static void handlePacket(const int sock,const InetAddress *const ip,Packet &pkt)
|
|||
printf("%s HELLO rejected: identity address collision!" ZT_EOL_S,ip->toString(ipstr));
|
||||
// TODO: send error
|
||||
return;
|
||||
} else {
|
||||
printf("* invalid identity found and discarded: %s" ZT_EOL_S,id.toString(false, tmpstr));
|
||||
std::lock_guard<std::mutex> p_l(s_peersByVirtAddr_l);
|
||||
s_peersByVirtAddr.erase(source);
|
||||
peer.zero();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -327,6 +322,7 @@ static void handlePacket(const int sock,const InetAddress *const ip,Packet &pkt)
|
|||
peer = p->second;
|
||||
}
|
||||
}
|
||||
if (peer) {
|
||||
if (!pkt.dearmor(peer->key)) {
|
||||
printf("%s HELLO rejected: packet authentication failed" ZT_EOL_S,ip->toString(ipstr));
|
||||
return;
|
||||
|
@ -335,9 +331,11 @@ static void handlePacket(const int sock,const InetAddress *const ip,Packet &pkt)
|
|||
printf("%s packet rejected: decompression failed" ZT_EOL_S,ip->toString(ipstr));
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (likely(peer)) {
|
||||
const int64_t now = OSUtils::now();
|
||||
|
||||
if (ip->isV4()) {
|
||||
|
@ -516,7 +514,6 @@ static void handlePacket(const int sock,const InetAddress *const ip,Packet &pkt)
|
|||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// If we made it here, we are forwarding this packet to someone else and also possibly
|
||||
// sending a RENDEZVOUS message.
|
||||
|
|
Loading…
Add table
Reference in a new issue