Bugzilla – Bug 1281
Checksum not calculated when doing IP fragmentation
Last modified: 2011-10-18 18:20:57 UTC
Component: ipv4-l3-protocol.cc OS: Ubuntu 11.04 (natty) Kernel Linux 2.6.38-11-generic GNOME 2.32.1 Summary: In the file ipv4-l3-protocol.cc there is a bug where the checksum isn't calculated when IP fragmentation is needed when checksum is enabled. Description: In the function doFragmentation the packet is stripped of its IP header and split into each fragment. When the IP header is recreated for each fragment, the function never checks to see if checksums are enabled. This makes it so fragments will always have a checksum of 0x0000. Steps to reproduce: 1. Enable checksum and pcap 2. Send message large than MTU 3. Open pcap file and view IP checksum of fragmented packets Actual Results: Checksum is 0x0000 for all fragmented packets Expected Results: Checksum should be calculated for each fragmented packet Version: 3.12.1 on Ubuntu 11.04 Additional Information: My program that discovered this bug is using ns3 to connect to a real outside network. I have not been able to test if this is the case when packets are sent between simulated nodes. So it might be the case that only when sending packets to an external network will cause this bug to occur. I have fixed this bug temporarily in my code by putting the code below in the function doFragmentation() in ipv4-l3-protocol.cc. if (Node::ChecksumEnabled ()) { fragmentHeader.EnableChecksum (); }
Created attachment 1258 [details] Program to reproduce the issue The issue can be seen for simulated nodes with the attached program. Packets get dropped because the checksum is incorrect during reassembly.
*** This bug has been marked as a duplicate of bug 1260 ***