summaryrefslogtreecommitdiff
path: root/security/ssh2/files/patch-al
blob: 9b8ef9f85303de406172ad4ec7a1e1cf51d02801 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
*** sshconnect.c.orig	Sun Apr  6 03:57:04 1997
--- sshconnect.c	Wed Apr 16 23:04:17 1997
***************
*** 302,307 ****
--- 302,313 ----
      {
        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));
+ #else
        for (p = 1023; p > 512; p--)
  	{
  	  sock = socket(AF_INET, SOCK_STREAM, 0);
***************
*** 329,334 ****
--- 335,341 ----
  	    }
  	  fatal("bind: %.100s", strerror(errno));
  	}
+ #endif
        debug("Allocated local port %d.", p);
      }
    else