mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-14 02:27:38 -07:00
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:
parent
faff84e63a
commit
5bb854e504
6 changed files with 27 additions and 17 deletions
10
testnet.cpp
10
testnet.cpp
|
@ -559,11 +559,11 @@ static void doUnicast(const std::vector<std::string> &cmd)
|
|||
SimNode *receiver = nodes[*r];
|
||||
SharedPtr<TestEthernetTap> rtap(receiver->tapFactory.getByNwid(nwid));
|
||||
if (rtap) {
|
||||
while (rtap->getNextReceivedFrame(frame,1)) {
|
||||
if (rtap->getNextReceivedFrame(frame,5)) {
|
||||
if ((frame.len == frameLen)&&(!memcmp(frame.data + 16,pkt.data + 16,frameLen - 16))) {
|
||||
uint64_t ints[2];
|
||||
memcpy(ints,frame.data,16);
|
||||
printf("%s <- %.10llx received test packet, latency == %llums"ZT_EOL_S,r->toString().c_str(),ints[0],frame.timestamp - ints[1]);
|
||||
printf("%s <- %.10llx received test packet, length == %u, latency == %llums"ZT_EOL_S,r->toString().c_str(),ints[0],frame.len,frame.timestamp - ints[1]);
|
||||
receivedPairs.insert(std::pair<Address,Address>(Address(ints[0]),*r));
|
||||
} else {
|
||||
printf("%s !! got spurious packet, length == %u, etherType == 0x%.4x"ZT_EOL_S,r->toString().c_str(),frame.len,frame.etherType);
|
||||
|
@ -647,19 +647,19 @@ static void doMulticast(const std::vector<std::string> &cmd)
|
|||
|
||||
printf("---------- waiting %llu seconds..."ZT_EOL_S,tout / 1000ULL);
|
||||
|
||||
uint64_t toutend = Utils::now() + tout;
|
||||
unsigned int receiveCount = 0;
|
||||
TestEthernetTap::TestFrame frame;
|
||||
uint64_t toutend = Utils::now() + tout;
|
||||
do {
|
||||
for(std::map< Address,SimNode * >::iterator nn(nodes.begin());nn!=nodes.end();++nn) {
|
||||
SimNode *receiver = nn->second;
|
||||
SharedPtr<TestEthernetTap> rtap(receiver->tapFactory.getByNwid(nwid));
|
||||
if (rtap) {
|
||||
while (rtap->getNextReceivedFrame(frame,1)) {
|
||||
if (rtap->getNextReceivedFrame(frame,5)) {
|
||||
if ((frame.len == frameLen)&&(!memcmp(frame.data + 16,pkt.data + 16,frameLen - 16))) {
|
||||
uint64_t ints[2];
|
||||
memcpy(ints,frame.data,16);
|
||||
printf("%s <- %.10llx received test packet, latency == %llums"ZT_EOL_S,nn->first.toString().c_str(),ints[0],frame.timestamp - ints[1]);
|
||||
printf("%s <- %.10llx received test packet, length == %u, latency == %llums"ZT_EOL_S,nn->first.toString().c_str(),ints[0],frame.len,frame.timestamp - ints[1]);
|
||||
++receiveCount;
|
||||
} else {
|
||||
printf("%s !! got spurious packet, length == %u, etherType == 0x%.4x"ZT_EOL_S,nn->first.toString().c_str(),frame.len,frame.etherType);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue