mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 20:43:44 +02:00
Cleanup.
This commit is contained in:
parent
3a1ec07db0
commit
ab0806a036
3 changed files with 3 additions and 10 deletions
|
@ -99,7 +99,6 @@ bool IncomingPacket::tryDecode(const RuntimeEnvironment *RR,void *tPtr)
|
||||||
default: // ignore unknown verbs, but if they pass auth check they are "received"
|
default: // ignore unknown verbs, but if they pass auth check they are "received"
|
||||||
peer->received(tPtr,_path,hops(),packetId(),v,0,Packet::VERB_NOP,false,0);
|
peer->received(tPtr,_path,hops(),packetId(),v,0,Packet::VERB_NOP,false,0);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case Packet::VERB_HELLO: return _doHELLO(RR,tPtr,true);
|
case Packet::VERB_HELLO: return _doHELLO(RR,tPtr,true);
|
||||||
case Packet::VERB_ERROR: return _doERROR(RR,tPtr,peer);
|
case Packet::VERB_ERROR: return _doERROR(RR,tPtr,peer);
|
||||||
case Packet::VERB_OK: return _doOK(RR,tPtr,peer);
|
case Packet::VERB_OK: return _doOK(RR,tPtr,peer);
|
||||||
|
@ -122,7 +121,7 @@ bool IncomingPacket::tryDecode(const RuntimeEnvironment *RR,void *tPtr)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} catch ( ... ) {
|
} catch ( ... ) {
|
||||||
RR->t->incomingPacketInvalid(tPtr,_path,packetId(),sourceAddress,hops(),verb(),"unexpected exception in tryDecode() (outer)");
|
RR->t->incomingPacketInvalid(tPtr,_path,packetId(),sourceAddress,hops(),verb(),"unexpected exception in tryDecode()");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -332,7 +331,7 @@ bool IncomingPacket::_doHELLO(const RuntimeEnvironment *RR,void *tPtr,const bool
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle COR if present (older versions don't send this)
|
// Certificates of representation (if present)
|
||||||
if ((ptr + 2) <= size()) {
|
if ((ptr + 2) <= size()) {
|
||||||
if (at<uint16_t>(ptr) > 0) {
|
if (at<uint16_t>(ptr) > 0) {
|
||||||
CertificateOfRepresentation cor;
|
CertificateOfRepresentation cor;
|
||||||
|
|
|
@ -1274,12 +1274,6 @@ public:
|
||||||
/**
|
/**
|
||||||
* Encrypt/decrypt a separately armored portion of a packet
|
* Encrypt/decrypt a separately armored portion of a packet
|
||||||
*
|
*
|
||||||
* This currently uses Salsa20/12, but any message that uses this should
|
|
||||||
* incorporate a cipher selector to permit this to be changed later. To
|
|
||||||
* ensure that key stream is not reused, the key is slightly altered for
|
|
||||||
* this use case and the same initial 32 keystream bytes that are taken
|
|
||||||
* for MAC in ordinary armor() are also skipped here.
|
|
||||||
*
|
|
||||||
* This is currently only used to mask portions of HELLO as an extra
|
* This is currently only used to mask portions of HELLO as an extra
|
||||||
* security precation since most of that message is sent in the clear.
|
* security precation since most of that message is sent in the clear.
|
||||||
*
|
*
|
||||||
|
|
|
@ -60,7 +60,7 @@ void Switch::onRemotePacket(void *tPtr,const int64_t localSocket,const InetAddre
|
||||||
try {
|
try {
|
||||||
const uint64_t now = RR->node->now();
|
const uint64_t now = RR->node->now();
|
||||||
|
|
||||||
SharedPtr<Path> path(RR->topology->getPath(localSocket,fromAddr));
|
const SharedPtr<Path> path(RR->topology->getPath(localSocket,fromAddr));
|
||||||
path->received(now);
|
path->received(now);
|
||||||
|
|
||||||
if (len == 13) {
|
if (len == 13) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue