]> andersk Git - openssh.git/blobdiff - sshconnect.c
- guenther@cvs.openbsd.org 2009/12/20 07:28:36
[openssh.git] / sshconnect.c
index 3e57e859df239d9968a1abf6fe01d54335f857e1..3c8308ffb9755ac639065a334c7c0842c099d1a4 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect.c,v 1.214 2009/05/28 16:50:16 andreas Exp $ */
+/* $OpenBSD: sshconnect.c,v 1.216 2009/11/10 04:30:45 dtucker Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -28,6 +28,7 @@
 
 #include <ctype.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <netdb.h>
 #ifdef HAVE_PATHS_H
 #include <paths.h>
@@ -190,9 +191,13 @@ ssh_create_socket(int privileged, struct addrinfo *ai)
                        debug("Allocated local port %d.", p);
                return sock;
        }
-       sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
-       if (sock < 0)
+       sock = socket_rdomain(ai->ai_family, ai->ai_socktype, ai->ai_protocol,
+           options.rdomain);
+       if (sock < 0) {
                error("socket: %.100s", strerror(errno));
+               return -1;
+       }
+       fcntl(sock, F_SETFD, FD_CLOEXEC);
 
        /* Bind the socket to an alternative local IP address */
        if (options.bind_address == NULL)
This page took 0.034112 seconds and 4 git commands to generate.