Patch for pre27

Damien Miller djm at mindrot.org
Mon Jan 17 15:25:35 EST 2000


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Apply this patch to 1.2.1pre27. It fixes an occasional failure.

If you want to see the failure in action:

while [ 1 ] ; do ssh localhost true || break ; done

(assumes you have an RSA key set up on localhost)

Damien

- --
| "Bombay is 250ms from New York in the new world order" - Alan Cox
| Damien Miller - http://www.mindrot.org/
| Email: djm at mindrot.org (home) -or- djm at ibs.com.au (work)


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.0 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE4gpnDormJ9RG1dI8RArUyAKDepJb4yJx6rpEVTkmBYodrKFehuACgikJM
KfelifCGDrV8bK56x3v8V6c=
=E0Ge
-----END PGP SIGNATURE-----
-------------- next part --------------
? ssh.tr
Index: ChangeLog
===================================================================
RCS file: /var/cvs/openssh/ChangeLog,v
retrieving revision 1.167
diff -u -r1.167 ChangeLog
--- ChangeLog	2000/01/17 02:22:55	1.167
+++ ChangeLog	2000/01/17 04:21:33
@@ -9,6 +9,8 @@
    deliver (no IPv6 kernel kernel support)
  - Released 1.2.1pre27
 
+ - Fix rresvport_af failure errors (logic error in bsd-bindresvport.c)
+
 20000116
  - Renamed --with-xauth-path to --with-xauth
  - Added --with-pid-dir option
Index: bsd-bindresvport.c
===================================================================
RCS file: /var/cvs/openssh/bsd-bindresvport.c,v
retrieving revision 1.2
diff -u -r1.2 bsd-bindresvport.c
--- bsd-bindresvport.c	2000/01/16 22:52:47	1.2
+++ bsd-bindresvport.c	2000/01/17 04:21:33
@@ -84,17 +84,17 @@
 	sa->sa_family = af;
 
 	if (*portp == 0)
-		*portp = (arc4random() % NPORTS) + STARTPORT;
+		*portp = (u_int16_t)(arc4random() % NPORTS) + STARTPORT;
 
 	for(i = 0; i < NPORTS; i++) {
 		error = bind(sd, sa, salen);
-
+		
 		/* Terminate on success */
 		if (error == 0)
 			break;
 			
 		/* Terminate on errors, except "address already in use" */
-		if ((error < 0) && ((errno != EADDRINUSE) || (errno != EINVAL)))
+		if ((error < 0) && !((errno == EADDRINUSE) || (errno == EINVAL)))
 			break;
 			
 		*portp = (i % NPORTS) + STARTPORT;


More information about the openssh-unix-dev mailing list