Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix alignment issue of ones_complement_checksum
The ones_complement_checksum function assumes that the bytes passed into it are aligned on 16 bit boundaries. When using gcc (GCC) 6.2.1 20160916 (Red Hat 6.2.1-2) with -O2, this does not seem to hold true anymore; assuming 16 bit alignment will lead to accesses to uninitialized memory and wrong checksums. This commit adds a minimally invasive change that does not assume alignment anymore. This might have a small performance impact for every single packet we process. This error occured reproducibly when called from icmp6_checksum.
- Loading branch information