[openssh-commits] [openssh] 08/10: upstream: mux proxy sockets also share in and out fds, so using

git+noreply at mindrot.org git+noreply at mindrot.org
Tue Sep 15 15:38:12 AEST 2026


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

djm pushed a commit to branch master
in repository openssh.

commit 7f671c49eba7b1eacaf4ca35e9f4b65cef14fa8a
Author: djm at openbsd.org <djm at openbsd.org>
AuthorDate: Mon Sep 14 02:40:27 2026 +0000

    upstream: mux proxy sockets also share in and out fds, so using
    
    this as a heuristic to decide whether the connection is on an inet/inet6
    socket is incorrect.
    
    Fixes breakage in t-multiplex after recent pledge(2) changes where
    the packet code would attempt to set TCP_NODELAY on a mux proxy
    connection (which is AF_UNIX).
    
    OpenBSD-Commit-ID: f6706e90d499ac0a22322df11935205f38c5ae85
---
 packet.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/packet.c b/packet.c
index 63dcb5351..1909a6670 100644
--- a/packet.c
+++ b/packet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.341 2026/07/23 06:33:06 djm Exp $ */
+/* $OpenBSD: packet.c,v 1.342 2026/09/14 02:40:27 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -451,14 +451,16 @@ ssh_packet_connection_is_on_socket(struct ssh *ssh)
 	state = ssh->state;
 	if (state->connection_in == -1 || state->connection_out == -1)
 		return 0;
-	/* filedescriptors in and out are the same, so it's a socket */
-	if (state->connection_in == state->connection_out)
-		return 1;
 	fromlen = sizeof(from);
 	memset(&from, 0, sizeof(from));
 	if (getpeername(state->connection_in, (struct sockaddr *)&from,
 	    &fromlen) == -1)
 		return 0;
+	if (from.ss_family != AF_INET && from.ss_family != AF_INET6)
+		return 0;
+	/* filedescriptors in and out are the same, so it's a socket */
+	if (state->connection_in == state->connection_out)
+		return 1;
 	tolen = sizeof(to);
 	memset(&to, 0, sizeof(to));
 	if (getpeername(state->connection_out, (struct sockaddr *)&to,
@@ -466,8 +468,6 @@ ssh_packet_connection_is_on_socket(struct ssh *ssh)
 		return 0;
 	if (fromlen != tolen || memcmp(&from, &to, fromlen) != 0)
 		return 0;
-	if (from.ss_family != AF_INET && from.ss_family != AF_INET6)
-		return 0;
 	return 1;
 }
 

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


More information about the openssh-commits mailing list