Fixed missing FCS calculation for ACKs.

This commit is contained in:
Erwan Livolant
2014-03-20 14:44:10 +01:00
parent 66671645d8
commit 0fe6713ec4
2 changed files with 9 additions and 0 deletions
+3
View File
@@ -72,6 +72,9 @@ int main (int argc, char *argv[])
lrWpanHelper.EnableLogComponents ();
}
// Enable calculation of FCS in the trailers. Only necessary when interacting with real devices or wireshark.
// GlobalValue::Bind ("ChecksumEnabled", BooleanValue (true));
// Create 2 nodes, and a NetDevice for each one
Ptr<Node> n0 = CreateObject <Node> ();
Ptr<Node> n1 = CreateObject <Node> ();
+6
View File
@@ -651,6 +651,12 @@ LrWpanMac::SendAck (uint8_t seqno)
LrWpanMacTrailer macTrailer;
Ptr<Packet> ackPacket = Create<Packet> (0);
ackPacket->AddHeader (macHdr);
// Calculate FCS if the global attribute ChecksumEnable is set.
if (Node::ChecksumEnabled ())
{
macTrailer.EnableFcs (true);
macTrailer.SetFcs (ackPacket);
}
ackPacket->AddTrailer (macTrailer);
// Enqueue the ACK packet for further processing