summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Hieber <rhi@pengutronix.de>2021-11-25 16:22:19 +0100
committerRobert Schwebel <r.schwebel@pengutronix.de>2021-11-26 10:33:18 +0100
commitfb3e1645e6b5d0584d79ce01533902dc5fbbb935 (patch)
tree61268f0dc8dd922eb02baf13f4c3839c35718596
parent04a4e89de2b14e7244d4fad6e32448d40846b948 (diff)
downloadDistroKit-fb3e1645e6b5d0584d79ce01533902dc5fbbb935.tar.gz
DistroKit-fb3e1645e6b5d0584d79ce01533902dc5fbbb935.tar.xz
v7a: run: really constrain the forwarded SSH port to <= 64000
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 <jbe@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
-rwxr-xr-xconfigs/platform-v7a/run2
1 files changed, 1 insertions, 1 deletions
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