Correcting endianness handling in UDP implementation