From fb3e1645e6b5d0584d79ce01533902dc5fbbb935 Mon Sep 17 00:00:00 2001 From: Roland Hieber Date: Thu, 25 Nov 2021 16:22:19 +0100 Subject: v7a: run: really constrain the forwarded SSH port to <= 64000 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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). Fixes: d975eb8b04087f8606d8 (2021-04-26, "v7a: run: make the SSH forwarding port multiprocess-compatible") Reported-by: Jürgen Borleis Signed-off-by: Roland Hieber --- configs/platform-v7a/run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configs/platform-v7a') diff --git a/configs/platform-v7a/run b/configs/platform-v7a/run index c1297bb..8de9c13 100755 --- a/configs/platform-v7a/run +++ b/configs/platform-v7a/run @@ -39,7 +39,7 @@ fi # 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 -- cgit v1.2.3