more consistent naming and formatting

This commit is contained in:
Lennon Day Reynolds 2025-07-15 13:13:44 -07:00
parent 8285e0f45b
commit 25b2814916
2 changed files with 9 additions and 11 deletions

View file

@ -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;
@ -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++;
}

View file

@ -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;