Fix a nasty bug introduced in packet fragmentation a while back during refactoring, and a few other things related to multicast.

This commit is contained in:
Adam Ierymenko 2014-10-28 17:25:34 -07:00
parent faff84e63a
commit 5bb854e504
6 changed files with 27 additions and 17 deletions

View file

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