diff --git a/sbin/ping/main.c b/sbin/ping/main.c index 1d1816361788..8a572cb3c914 100644 --- a/sbin/ping/main.c +++ b/sbin/ping/main.c @@ -149,7 +149,7 @@ main(int argc, char *argv[]) hints.ai_socktype = SOCK_RAW; if (feature_present("inet") && !feature_present("inet6")) hints.ai_family = AF_INET; - if (feature_present("inet6") && !feature_present("inet")) + else if (feature_present("inet6") && !feature_present("inet")) hints.ai_family = AF_INET6; else hints.ai_family = AF_UNSPEC;