mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-08-02 07:02:49 +02:00
more consistent naming and formatting
This commit is contained in:
parent
8285e0f45b
commit
25b2814916
2 changed files with 9 additions and 11 deletions
|
@ -143,7 +143,7 @@ void Switch::onRemotePacket(void* tPtr, const int64_t localSocket, const InetAdd
|
|||
rq->frag0.append(rq->frags[f - 1].payload(), rq->frags[f - 1].payloadLength());
|
||||
}
|
||||
|
||||
if (rq->frag0.tryDecode(RR,tPtr,flowId)) {
|
||||
if (rq->frag0.tryDecode(RR, tPtr, flowId)) {
|
||||
rq->timestamp = 0; // packet decoded, free entry
|
||||
} else {
|
||||
rq->complete = true; // set complete flag but leave entry since it probably needs WHOIS or something
|
||||
|
@ -278,9 +278,7 @@ void Switch::onLocalEthernet(void* tPtr, const SharedPtr<Network>& network, cons
|
|||
}
|
||||
|
||||
// VL2 fragmentation metric: oversized frame from TAP device (TX)
|
||||
unsigned int tap_mtu = network->config().mtu;
|
||||
bool was_fragmented_at_vl2 = (len > tap_mtu);
|
||||
if (was_fragmented_at_vl2) {
|
||||
if (len > network->config().mtu) {
|
||||
Metrics::vl2_oversized_frame_tx++;
|
||||
// Just measure, do not drop or return
|
||||
return;
|
||||
|
@ -974,8 +972,8 @@ void Switch::doAnythingWaitingForPeer(void* tPtr, const SharedPtr<Peer>& peer)
|
|||
for (unsigned int ptr = 0; ptr < ZT_RX_QUEUE_SIZE; ++ptr) {
|
||||
RXQueueEntry* const rq = &(_rxQueue[ptr]);
|
||||
Mutex::Lock rql(rq->lock);
|
||||
if ((rq->timestamp)&&(rq->complete)) {
|
||||
if ((rq->frag0.tryDecode(RR, tPtr, rq->flowId))||((now - rq->timestamp) > ZT_RECEIVE_QUEUE_TIMEOUT)) {
|
||||
if ((rq->timestamp) && (rq->complete)) {
|
||||
if ((rq->frag0.tryDecode(RR, tPtr, rq->flowId)) || ((now - rq->timestamp) > ZT_RECEIVE_QUEUE_TIMEOUT)) {
|
||||
rq->timestamp = 0;
|
||||
if ((now - rq->timestamp) > ZT_RECEIVE_QUEUE_TIMEOUT) {
|
||||
Metrics::vl1_incomplete_reassembly_rx++;
|
||||
|
@ -1041,8 +1039,8 @@ unsigned long Switch::doTimerTasks(void* tPtr, int64_t now)
|
|||
for (unsigned int ptr = 0; ptr < ZT_RX_QUEUE_SIZE; ++ptr) {
|
||||
RXQueueEntry* const rq = &(_rxQueue[ptr]);
|
||||
Mutex::Lock rql(rq->lock);
|
||||
if ((rq->timestamp)&&(rq->complete)) {
|
||||
if ((rq->frag0.tryDecode(RR, tPtr, rq->flowId))||((now - rq->timestamp) > ZT_RECEIVE_QUEUE_TIMEOUT)) {
|
||||
if ((rq->timestamp) && (rq->complete)) {
|
||||
if ((rq->frag0.tryDecode(RR, tPtr, rq->flowId)) || ((now - rq->timestamp) > ZT_RECEIVE_QUEUE_TIMEOUT)) {
|
||||
rq->timestamp = 0;
|
||||
if ((now - rq->timestamp) > ZT_RECEIVE_QUEUE_TIMEOUT) {
|
||||
Metrics::vl1_incomplete_reassembly_rx++;
|
||||
|
@ -1135,7 +1133,7 @@ bool Switch::_trySend(void* tPtr, Packet& packet, bool encrypt, int32_t flowId)
|
|||
return false;
|
||||
}
|
||||
|
||||
void Switch::_sendViaSpecificPath(void* tPtr, SharedPtr<Peer> peer, SharedPtr<Path> viaPath, uint16_t userSpecifiedMtu, int64_t now, Packet& packet, bool encrypt, int32_t flowId, bool was_fragmented_at_vl2)
|
||||
void Switch::_sendViaSpecificPath(void* tPtr, SharedPtr<Peer> peer, SharedPtr<Path> viaPath, uint16_t userSpecifiedMtu, int64_t now, Packet& packet, bool encrypt, int32_t flowId, bool fragmentedAtVl2)
|
||||
{
|
||||
unsigned int mtu = ZT_DEFAULT_PHYSMTU;
|
||||
uint64_t trustedPathId = 0;
|
||||
|
@ -1163,7 +1161,7 @@ void Switch::_sendViaSpecificPath(void* tPtr, SharedPtr<Peer> peer, SharedPtr<Pa
|
|||
if (chunkSize < packet.size()) {
|
||||
// Too big for one packet, fragment the rest
|
||||
Metrics::vl1_fragments_per_packet_hist.Observe(2);
|
||||
if (was_fragmented_at_vl2) {
|
||||
if (fragmentedAtVl2) {
|
||||
Metrics::vl1_vl2_double_fragmentation_tx++;
|
||||
}
|
||||
|
||||
|
|
|
@ -206,7 +206,7 @@ class Switch {
|
|||
private:
|
||||
bool _shouldUnite(const int64_t now, const Address& source, const Address& destination);
|
||||
bool _trySend(void* tPtr, Packet& packet, bool encrypt, int32_t flowId = ZT_QOS_NO_FLOW); // packet is modified if return is true
|
||||
void _sendViaSpecificPath(void* tPtr, SharedPtr<Peer> peer, SharedPtr<Path> viaPath, uint16_t userSpecifiedMtu, int64_t now, Packet& packet, bool encrypt, int32_t flowId, bool was_fragmented_at_vl2);
|
||||
void _sendViaSpecificPath(void* tPtr, SharedPtr<Peer> peer, SharedPtr<Path> viaPath, uint16_t userSpecifiedMtu, int64_t now, Packet& packet, bool encrypt, int32_t flowId, bool fragmentedAtVl2);
|
||||
void _recordOutgoingPacketMetrics(const Packet& p);
|
||||
|
||||
const RuntimeEnvironment* const RR;
|
||||
|
|
Loading…
Add table
Reference in a new issue