diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-10-28 17:25:34 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-10-28 17:25:34 -0700 |
commit | 5bb854e504a0db968b47c0a983d0148629e126e7 (patch) | |
tree | dc16e7f9f66fdc00683ad85b3ef126630f9c06be /node/Switch.cpp | |
parent | faff84e63a2d58dd110015cfd3d6f5111756cefe (diff) | |
download | infinitytier-5bb854e504a0db968b47c0a983d0148629e126e7.tar.gz infinitytier-5bb854e504a0db968b47c0a983d0148629e126e7.zip |
Fix a nasty bug introduced in packet fragmentation a while back during refactoring, and a few other things related to multicast.
Diffstat (limited to 'node/Switch.cpp')
-rw-r--r-- | node/Switch.cpp | 8 |
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; } |