Correcting endianness issues surrounding IP address manipulation