summaryrefslogtreecommitdiff
path: root/node/Switch.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'node/Switch.cpp')
-rw-r--r--node/Switch.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/node/Switch.cpp b/node/Switch.cpp
index 4819bd56..7c63761b 100644
--- a/node/Switch.cpp
+++ b/node/Switch.cpp
@@ -785,9 +785,9 @@ bool Switch::_trySend(const Packet &packet,bool encrypt)
++fragsRemaining;
unsigned int totalFragments = fragsRemaining + 1;
- for(unsigned int f=0;f<fragsRemaining;++f) {
+ for(unsigned int fno=1;fno<totalFragments;++fno) {
chunkSize = std::min(remaining,(unsigned int)(ZT_UDP_DEFAULT_PAYLOAD_MTU - ZT_PROTO_MIN_FRAGMENT_LENGTH));
- Packet::Fragment frag(tmp,fragStart,chunkSize,f + 1,totalFragments);
+ Packet::Fragment frag(tmp,fragStart,chunkSize,fno,totalFragments);
via->send(RR,frag.data(),frag.size(),now);
fragStart += chunkSize;
remaining -= chunkSize;
@@ -795,7 +795,9 @@ bool Switch::_trySend(const Packet &packet,bool encrypt)
}
return true;
}
- } else requestWhois(packet.destination());
+ } else {
+ requestWhois(packet.destination());
+ }
return false;
}