ipv4 compareTo: If the unsigned 32-bit x and _key have different sign bits, the 32-bit signed comparison needs to be reversed. Alternatively, converted to long for the substract, and back to int for the result return. Port compare was fine.