From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Thu, 01 Aug 2024 13:38:32 +0200 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sZU8e-0057GP-2l for lore@lore.pengutronix.de; Thu, 01 Aug 2024 13:38:32 +0200 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1sZU8d-0004pC-VU; Thu, 01 Aug 2024 13:38:32 +0200 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sZU8U-0004fW-Fa; Thu, 01 Aug 2024 13:38:22 +0200 Received: from [2a0a:edc0:0:1101:1d::54] (helo=dude05.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sZU8U-003l1Y-2A; Thu, 01 Aug 2024 13:38:22 +0200 Received: from localhost ([::1] helo=dude05.red.stw.pengutronix.de) by dude05.red.stw.pengutronix.de with esmtp (Exim 4.96) (envelope-from ) id 1sZU8T-00GheB-39; Thu, 01 Aug 2024 13:38:22 +0200 From: Ahmad Fatoum To: distrokit@pengutronix.de Date: Thu, 1 Aug 2024 13:38:19 +0200 Message-Id: <20240801113819.3981009-6-a.fatoum@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240801113819.3981009-1-a.fatoum@pengutronix.de> References: <20240801113819.3981009-1-a.fatoum@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [DistroKit] [PATCH 6/6] v7a_noneon: run: really constrain the forwarded SSH port to <= 64000 X-BeenThere: distrokit@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: DistroKit Mailinglist List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ahmad Fatoum Sender: "DistroKit" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: distrokit-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false The variable expansion braces should have been arithmetic evaluation parentheses, which had the effect that the PPID was always used as a port number (which incidentally works fine for PPIDs < 65535). This was fixed in configs/platform-v7a/run by commit fb3e1645e6b5 ("v7a: run: really constrain the forwarded SSH port to <= 64000"), so apply the same fix here. Fixes: 5d2b3d23b2da ("platform-v7a_noneon: sama5: platform w/out NEON extension") Signed-off-by: Ahmad Fatoum --- configs/platform-v7a_noneon/run | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configs/platform-v7a_noneon/run b/configs/platform-v7a_noneon/run index ccdcdb91c767..0307e982a334 100755 --- a/configs/platform-v7a_noneon/run +++ b/configs/platform-v7a_noneon/run @@ -31,10 +31,10 @@ if [ ! -e "${QEMU_EXEC}" ]; then exit 1 fi -# the port to which an sshd would connect (in the emulated sysem) +# the port to which an sshd would connect (in the emulated system) SSH_INTERNAL_PORT=22 # the port which QEMU opens at the host side to give access to the ${SSH_INTERNAL_PORT} -SSH_EXTERNAL_PORT=${QEMU_SSH_PORT:-${PPID%64000+1025}} +SSH_EXTERNAL_PORT=${QEMU_SSH_PORT:-$((PPID%64000+1025))} # check if vde is available for networking if [ -z "${VDE_SOCKET}" ]; then -- 2.39.2