Subject: Re: kernel option for "socket: Protocol not supported"
To: None <tech-kern@NetBSD.org>
From: Ignatios Souvatzis <is@netbsd.org>
List: tech-kern
Date: 02/27/2006 15:21:20
--oJ71EGRlYNjSvfq7
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hello,

On Wed, Feb 22, 2006 at 01:21:41PM -0500, George Georgalis wrote:

> thanks all for your interest! can someone send me a clumitive
> patch to try out? I presume this will apply to netbsd-3-0?

This is diffed against netbsd-3-0, and builds. I believe in your
situation in the way you desire, but you'll have to test it yourself.

Please report - I want to commit this to -current.

Regards,
	-is

Index: crypto/dist/ssh/sshconnect.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/src/crypto/dist/ssh/sshconnect.c,v
retrieving revision 1.30
diff -u -r1.30 sshconnect.c
--- crypto/dist/ssh/sshconnect.c	13 Feb 2005 05:57:27 -0000	1.30
+++ crypto/dist/ssh/sshconnect.c	27 Feb 2006 13:46:40 -0000
@@ -187,8 +187,15 @@
 		return sock;
 	}
 	sock =3D socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
-	if (sock < 0)
-		error("socket: %.100s", strerror(errno));
+	if (sock < 0) {
+		switch (errno) {
+		case EPROTONOSUPPORT:
+			debug("socket: %.100s", strerror(errno));
+			break;
+		default:
+			error("socket: %.100s", strerror(errno));
+		}
+	}
=20
 	/* Bind the socket to an alternative local IP address */
 	if (options.bind_address =3D=3D NULL)
@@ -370,7 +377,10 @@
 			/* Create a socket for connecting. */
 			sock =3D ssh_create_socket(needpriv, ai);
 			if (sock < 0)
-				/* Any error is already output */
+				/*
+				 * Any serious error is already output,
+				 * at least in the debug case.
+				 */
 				continue;
=20
 			if (timeout_connect(sock, ai->ai_addr, ai->ai_addrlen,

--=20
seal your e-mail: http://www.gnupg.org/

--oJ71EGRlYNjSvfq7
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (NetBSD)

iD8DBQFEAwrgN4tiz3B8hB0RAkoxAJ9Hei7qs7VVIztQ4MmyFp843gRQagCfZ6Ua
gvGMO2zoaHm5wJBajXZvNb4=
=2bne
-----END PGP SIGNATURE-----

--oJ71EGRlYNjSvfq7--