Minor code cleanup
Handle systems without IPv6 support correctly

Systems without IPv6 support should now be handled correctly. This
patchset also should be able to handle systems with IPv6 but without
IPv4. This might seem a little odd, but i see no reason not to
implement it.