Fix ip checksum: new ip value was being passed in the wrong byte order.
Some unused variables and printf debug cleaning.