diff options
| author | Alexander Egorenkov <Alexander.Egorenkov@ibm.com> | 2020-06-02 09:25:28 +0200 |
|---|---|---|
| committer | Andrey Konovalov <andreyknvl@gmail.com> | 2020-06-19 20:49:11 +0200 |
| commit | c655ec77ca937f773ed5905a8972d00eb59581e8 (patch) | |
| tree | 6a9a0e503a1c7eb08e1c83c526eab413db6e4ece /prog/encodingexec.go | |
| parent | 81abc33188b4caf19873b9676ab1d8dc0e3511ca (diff) | |
executor: fix endianness problem in internet checksum
csum_inet_update does not handle odd number of bytes
on big-endian architectures correctly. When calculating
the checksum of odd number of bytes, the last byte must be
interpreted as LSB on little-endian architectures and
as MSB on big-endian ones in a 16-bit half-word.
Futhermore, the checksum tests assume that the underlying architecture
is always little-endian. When a little-endian machine stores
a calculated checksum into memory, then the checksum's bytes
are automatically swapped. But this is NOT true on a big-endian
architecture.
Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
Diffstat (limited to 'prog/encodingexec.go')
0 files changed, 0 insertions, 0 deletions
