Detect if ipv6 should be used or not
Eliminate some compiler warnings