[openssh-commits] [openssh] 01/01: upstream: when connecting via socket (the default case), filter

git+noreply at mindrot.org git+noreply at mindrot.org
Thu Nov 16 10:05:39 AEDT 2023


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 26f3f3bbc69196d908cad6558c8c7dc5beb8d74a
Author: djm at openbsd.org <djm at openbsd.org>
Date:   Wed Nov 15 23:03:38 2023 +0000

    upstream: when connecting via socket (the default case), filter
    
    addresses by AddressFamily if one was specified. Fixes the case where, if
    CanonicalizeHostname is enabled, ssh may ignore AddressFamily. bz5326; ok
    dtucker
    
    OpenBSD-Commit-ID: 6c7d7751f6cd055126b2b268a7b64dcafa447439
---
 sshconnect.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/sshconnect.c b/sshconnect.c
index e6012f01..ff3d3501 100644
--- a/sshconnect.c
+++ b/sshconnect.c
@@ -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 <ylo at cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -481,6 +481,14 @@ ssh_connect_direct(struct ssh *ssh, const char *host, struct addrinfo *aitop,
 				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);
 

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list