Fixed missing FCS calculation for ACKs.
This commit is contained in:
@@ -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> ();
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user