Make one of our changes for -current work on 2.1. In -current, rresvport()

ignores it's argument (it's meaningless, the kernel keeps the state), but
2.1.x use it.  ssh was effectively giving a random port to 2.1.

Originally noticed by: John Polstra <jdp@polstra.com>
This commit is contained in:
Peter Wemm 1996-12-27 08:42:41 +00:00
parent 0ebe3bae3b
commit 67faab29d6
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=5106
2 changed files with 4 additions and 2 deletions

View file

@ -2,11 +2,12 @@
--- sshconnect.c Mon Aug 12 13:26:46 1996
***************
*** 235,240 ****
--- 235,245 ----
--- 235,246 ----
{
struct sockaddr_in sin;
int p;
+ #if defined(__FreeBSD__) && !defined(SOCKS)
+ p = 1023; /* Compat with old FreeBSD */
+ sock = rresvport(&p);
+ if (sock < 0)
+ fatal("rresvport: %.100s", strerror(errno));

View file

@ -2,11 +2,12 @@
--- sshconnect.c Mon Aug 12 13:26:46 1996
***************
*** 235,240 ****
--- 235,245 ----
--- 235,246 ----
{
struct sockaddr_in sin;
int p;
+ #if defined(__FreeBSD__) && !defined(SOCKS)
+ p = 1023; /* Compat with old FreeBSD */
+ sock = rresvport(&p);
+ if (sock < 0)
+ fatal("rresvport: %.100s", strerror(errno));