Apple challenge fails on some platforms

Some platforms handle bytewise operatons differently.
The code to extract the IP address produced a reverse order 
and the challenge response failed. 

(eg OPENWRT MIPS)

Use this code and it will work on any platform.