aboutsummaryrefslogtreecommitdiffstats
path: root/security/ssh/files/patch-al
blob: 839d1fe2b2bf10ff1fe2820a02d944b6eb9f2c84 (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	Wed May 12 20:19:29 1999
--- sshconnect.c	Sun Jun  6 02:39:02 1999
***************
*** 347,352 ****
--- 347,358 ----
      {
        struct sockaddr_in sin;
        int p;
+ #if (defined(__OpenBSD__) || 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);
***************
*** 374,379 ****
--- 380,386 ----
              }
            fatal("bind: %.100s", strerror(errno));
          }
+ #endif
        debug("Allocated local port %d.", p);
      }
    else