mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-03-13 15:56:26 +00:00
Fix for world size in OK(HELLO)
This commit is contained in:
parent
719233617c
commit
c312ae221f
@ -302,7 +302,7 @@ bool IncomingPacket::_doHELLO(const RuntimeEnvironment *RR)
|
|||||||
const unsigned int sizeAt = outp.size();
|
const unsigned int sizeAt = outp.size();
|
||||||
outp.addSize(2); // make room for 16-bit size field
|
outp.addSize(2); // make room for 16-bit size field
|
||||||
w.serialize(outp,false);
|
w.serialize(outp,false);
|
||||||
outp.setAt<uint16_t>(sizeAt,(uint16_t)(outp.size() - sizeAt));
|
outp.setAt<uint16_t>(sizeAt,(uint16_t)(outp.size() - (sizeAt + 2)));
|
||||||
} else {
|
} else {
|
||||||
outp.append((uint16_t)0); // no world update needed
|
outp.append((uint16_t)0); // no world update needed
|
||||||
}
|
}
|
||||||
@ -435,12 +435,12 @@ bool IncomingPacket::_doWHOIS(const RuntimeEnvironment *RR,const SharedPtr<Peer>
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
if (payloadLength() == ZT_ADDRESS_LENGTH) {
|
if (payloadLength() == ZT_ADDRESS_LENGTH) {
|
||||||
const SharedPtr<Peer> queried(RR->topology->getPeer(Address(payload(),ZT_ADDRESS_LENGTH)));
|
Identity queried(RR->topology->getIdentity(Address(payload(),ZT_ADDRESS_LENGTH)));
|
||||||
if (queried) {
|
if (queried) {
|
||||||
Packet outp(peer->address(),RR->identity.address(),Packet::VERB_OK);
|
Packet outp(peer->address(),RR->identity.address(),Packet::VERB_OK);
|
||||||
outp.append((unsigned char)Packet::VERB_WHOIS);
|
outp.append((unsigned char)Packet::VERB_WHOIS);
|
||||||
outp.append(packetId());
|
outp.append(packetId());
|
||||||
queried->identity().serialize(outp,false);
|
queried.serialize(outp,false);
|
||||||
outp.armor(peer->key(),true);
|
outp.armor(peer->key(),true);
|
||||||
RR->node->putPacket(_localAddress,_remoteAddress,outp.data(),outp.size());
|
RR->node->putPacket(_localAddress,_remoteAddress,outp.data(),outp.size());
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user