1999-06-15 20:14:04 +00:00
|
|
|
*** sshconnect.c.orig Wed May 12 20:19:29 1999
|
|
|
|
--- sshconnect.c Sun Jun 6 02:39:02 1999
|
1996-08-12 14:17:53 +00:00
|
|
|
***************
|
1999-06-15 20:14:04 +00:00
|
|
|
*** 347,352 ****
|
|
|
|
--- 347,358 ----
|
1996-08-12 14:17:53 +00:00
|
|
|
{
|
|
|
|
struct sockaddr_in sin;
|
|
|
|
int p;
|
1997-12-24 18:48:46 +00:00
|
|
|
+ #if (defined(__OpenBSD__) || defined(__FreeBSD__)) && !defined(SOCKS)
|
1999-06-15 20:14:04 +00:00
|
|
|
+ p = 1023; /* Compat with old FreeBSD */
|
|
|
|
+ sock = rresvport(&p);
|
|
|
|
+ if (sock < 0)
|
|
|
|
+ fatal("rresvport: %.100s", strerror(errno));
|
1996-08-12 14:17:53 +00:00
|
|
|
+ #else
|
|
|
|
for (p = 1023; p > 512; p--)
|
1999-06-15 20:14:04 +00:00
|
|
|
{
|
|
|
|
sock = socket(AF_INET, SOCK_STREAM, 0);
|
1996-08-12 14:17:53 +00:00
|
|
|
***************
|
1999-06-15 20:14:04 +00:00
|
|
|
*** 374,379 ****
|
|
|
|
--- 380,386 ----
|
|
|
|
}
|
|
|
|
fatal("bind: %.100s", strerror(errno));
|
|
|
|
}
|
1996-08-12 14:17:53 +00:00
|
|
|
+ #endif
|
|
|
|
debug("Allocated local port %d.", p);
|
|
|
|
}
|
|
|
|
else
|