Index: secure/usr.bin/ssh/Makefile =================================================================== --- secure/usr.bin/ssh/Makefile (revision 274711) +++ secure/usr.bin/ssh/Makefile (working copy) @@ -15,6 +15,10 @@ # gss-genr.c really belongs in libssh; see src/secure/lib/libssh/Makefile SRCS+= gss-genr.c +.if ${MK_INET6_SUPPORT} != "no" +CFLAGS+= -DINET6 +.endif + DPADD= ${LIBSSH} ${LIBUTIL} LDADD= -lssh -lutil USEPRIVATELIB= ssh Index: crypto/openssh/sshconnect.c =================================================================== --- crypto/openssh/sshconnect.c (revision 274711) +++ crypto/openssh/sshconnect.c (working copy) @@ -469,9 +469,15 @@ * sequence until the connection succeeds. */ for (ai = aitop; ai; ai = ai->ai_next) { - if (ai->ai_family != AF_INET && - ai->ai_family != AF_INET6) + switch (ai->ai_family) { + case AF_INET: +#ifdef INET6 + case AF_INET6: +#endif + break; + default: continue; + } if (getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop, sizeof(ntop), strport, sizeof(strport), NI_NUMERICHOST|NI_NUMERICSERV) != 0) {