=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/sshconnect.c,v retrieving revision 1.363 retrieving revision 1.364 diff -u -r1.363 -r1.364 --- src/usr.bin/ssh/sshconnect.c 2023/03/10 07:17:08 1.363 +++ src/usr.bin/ssh/sshconnect.c 2023/11/15 23:03:38 1.364 @@ -1,4 +1,4 @@ -/* $OpenBSD: sshconnect.c,v 1.363 2023/03/10 07:17:08 dtucker Exp $ */ +/* $OpenBSD: sshconnect.c,v 1.364 2023/11/15 23:03:38 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -459,6 +459,14 @@ errno = oerrno; continue; } + if (options.address_family != AF_UNSPEC && + ai->ai_family != options.address_family) { + debug2_f("skipping address [%s]:%s: " + "wrong address family", ntop, strport); + errno = 0; + continue; + } + debug("Connecting to %.200s [%.100s] port %s.", host, ntop, strport);