From: djm@openbsd.org Date: Sun, 19 Apr 2026 23:37:22 +0000 (+0000) Subject: upstream: correctly set extended type for client-side channels. X-Git-Url: http://git.ipfire.org/index.cgi?a=commitdiff_plain;h=HEAD;p=thirdparty%2Fopenssh-portable.git upstream: correctly set extended type for client-side channels. Fixes interactive vs bulk IPQoS for client->server traffic. ok job@ OpenBSD-Commit-ID: 34f5131face8d6dc4ae6955196e5fcafb3570cfe --- diff --git a/clientloop.c b/clientloop.c index 6a0e7b6b8..8f9d16ca8 100644 --- a/clientloop.c +++ b/clientloop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clientloop.c,v 1.422 2026/03/05 05:40:35 djm Exp $ */ +/* $OpenBSD: clientloop.c,v 1.423 2026/04/19 23:37:22 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -2711,7 +2711,7 @@ client_session2_setup(struct ssh *ssh, int id, int want_tty, int want_subsystem, { size_t i, j, len; int matched, r; - char *name, *val; + char *type = NULL, *cmdstring = NULL, *name, *val; Channel *c = NULL; debug2_f("id %d", id); @@ -2786,19 +2786,21 @@ client_session2_setup(struct ssh *ssh, int id, int want_tty, int want_subsystem, len = sshbuf_len(cmd); if (len > 0) { + if ((cmdstring = sshbuf_dup_string(cmd)) == NULL) + fatal_f("sshbuf_dup_string failed"); if (len > 900) len = 900; if (want_subsystem) { - debug("Sending subsystem: %.*s", - (int)len, (const u_char*)sshbuf_ptr(cmd)); + debug("Sending subsystem: %.*s", (int)len, cmdstring); channel_request_start(ssh, id, "subsystem", 1); client_expect_confirm(ssh, id, "subsystem", CONFIRM_CLOSE); + xasprintf(&type, "session:subsystem:%s", cmdstring); } else { - debug("Sending command: %.*s", - (int)len, (const u_char*)sshbuf_ptr(cmd)); + debug("Sending command: %.*s", (int)len, cmdstring); channel_request_start(ssh, id, "exec", 1); client_expect_confirm(ssh, id, "exec", CONFIRM_CLOSE); + xasprintf(&type, "session:command"); } if ((r = sshpkt_put_stringb(ssh, cmd)) != 0 || (r = sshpkt_send(ssh)) != 0) @@ -2808,7 +2810,11 @@ client_session2_setup(struct ssh *ssh, int id, int want_tty, int want_subsystem, client_expect_confirm(ssh, id, "shell", CONFIRM_CLOSE); if ((r = sshpkt_send(ssh)) != 0) fatal_fr(r, "send shell"); + xasprintf(&type, "session:shell"); } + channel_set_xtype(ssh, id, type); + free(cmdstring); + free(type); session_setup_complete = 1; client_repledge();