As was highlighted in #505 some unit tests were failing on IBM System Z, which is a big endian architecture.
I've reproduced all the failures on QEMU PowerPC VM which is also big endian. In most cases the failures were due to decoders using socket.ntohs() to convert from network byte order to host byte order, assuming host is little endian (x86).
On BE systems the function didn't actually convert since the host itself is BE, producing incorrect fields in the decoders.
This patch introduces compat.ntole() function which always converts from network order to LE and works consistently on both LE and BE systems.
Coverage increased (+0.06%) to 92.461% when pulling aef29e85ec8c296c0412b71d183d05e342b3fc44 on fix-big-endian-2 into b930e14e2d5b96bae68a2ec619b07e55bec4935a on master.
As was highlighted in #505 some unit tests were failing on IBM System Z, which is a big endian architecture. I've reproduced all the failures on QEMU PowerPC VM which is also big endian. In most cases the failures were due to decoders using
socket.ntohs()
to convert from network byte order to host byte order, assuming host is little endian (x86). On BE systems the function didn't actually convert since the host itself is BE, producing incorrect fields in the decoders. This patch introducescompat.ntole()
function which always converts from network order to LE and works consistently on both LE and BE systems.