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));
|
printf("%s HELLO rejected: identity address collision!" ZT_EOL_S,ip->toString(ipstr));
|
||||||
// TODO: send error
|
// TODO: send error
|
||||||
return;
|
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;
|
peer = p->second;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (peer) {
|
||||||
if (!pkt.dearmor(peer->key)) {
|
if (!pkt.dearmor(peer->key)) {
|
||||||
printf("%s HELLO rejected: packet authentication failed" ZT_EOL_S,ip->toString(ipstr));
|
printf("%s HELLO rejected: packet authentication failed" ZT_EOL_S,ip->toString(ipstr));
|
||||||
return;
|
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));
|
printf("%s packet rejected: decompression failed" ZT_EOL_S,ip->toString(ipstr));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (likely(peer)) {
|
|
||||||
const int64_t now = OSUtils::now();
|
const int64_t now = OSUtils::now();
|
||||||
|
|
||||||
if (ip->isV4()) {
|
if (ip->isV4()) {
|
||||||
|
@ -516,7 +514,6 @@ static void handlePacket(const int sock,const InetAddress *const ip,Packet &pkt)
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// If we made it here, we are forwarding this packet to someone else and also possibly
|
// If we made it here, we are forwarding this packet to someone else and also possibly
|
||||||
// sending a RENDEZVOUS message.
|
// sending a RENDEZVOUS message.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue