[openssh-commits] [openssh] 01/01: don't test IPv6 addresses if platform lacks support

git+noreply at mindrot.org git+noreply at mindrot.org
Sun Jan 8 12:11:42 AEDT 2023


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

djm pushed a commit to branch master
in repository openssh.

commit dd1249bd5c45128a908395c61b26996a70f82205
Author: Damien Miller <djm at mindrot.org>
Date:   Sun Jan 8 12:08:59 2023 +1100

    don't test IPv6 addresses if platform lacks support
---
 regress/dynamic-forward.sh | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/regress/dynamic-forward.sh b/regress/dynamic-forward.sh
index 1d988378..781fc3fc 100644
--- a/regress/dynamic-forward.sh
+++ b/regress/dynamic-forward.sh
@@ -10,6 +10,11 @@ cp $OBJ/ssh_config $OBJ/ssh_config.orig
 proxycmd="$OBJ/netcat -x 127.0.0.1:$FWDPORT -X"
 trace "will use ProxyCommand $proxycmd"
 
+# This is a reasonable proxy for IPv6 support.
+if ! config_defined HAVE_STRUCT_IN6_ADDR ; then
+	SKIP_IPV6=yes
+fi
+
 start_ssh() {
 	direction="$1"
 	arg="$2"
@@ -90,14 +95,16 @@ for d in D R; do
 	stop_ssh
 
 	verbose "PermitRemoteOpen=explicit"
-	start_ssh $d \
-	    PermitRemoteOpen="127.0.0.1:$PORT [::1]:$PORT localhost:$PORT"
+	permit="127.0.0.1:$PORT [::1]:$PORT localhost:$PORT"
+	test -z "$SKIP_IPV6" || permit="127.0.0.1:$PORT localhost:$PORT"
+	start_ssh $d PermitRemoteOpen="$permit"
 	check_socks $d Y
 	stop_ssh
 
 	verbose "PermitRemoteOpen=disallowed"
-	start_ssh $d \
-	    PermitRemoteOpen="127.0.0.1:1 [::1]:1 localhost:1"
+	permit="127.0.0.1:1 [::1]:1 localhost:1"
+	test -z "$SKIP_IPV6" || permit="127.0.0.1:1 localhost:1"
+	start_ssh $d PermitRemoteOpen="$permit"
 	check_socks $d N
 	stop_ssh
 done

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


More information about the openssh-commits mailing list