/* Creates a Unix domain socket in the given 'style' (either SOCK_DGRAM or
* SOCK_STREAM) that is bound to '*bind_path' (if 'bind_path' is non-null) and
* connected to '*connect_path' (if 'connect_path' is non-null). If 'nonblock'
- * is true, the socket is made non-blocking. If 'passcred' is true, the socket
- * is configured to receive SCM_CREDENTIALS control messages.
+ * is true, the socket is made non-blocking.
*
* Returns the socket's fd if successful, otherwise a negative errno value. */
int
-make_unix_socket(int style, bool nonblock, bool passcred OVS_UNUSED,
+make_unix_socket(int style, bool nonblock,
const char *bind_path, const char *connect_path)
{
int error;
}
}
-#ifdef SCM_CREDENTIALS
- if (passcred) {
- int enable = 1;
- if (setsockopt(fd, SOL_SOCKET, SO_PASSCRED, &enable, sizeof(enable))) {
- error = errno;
- goto error;
- }
- }
-#endif
-
return fd;
error:
/*
- * Copyright (c) 2008, 2009, 2010, 2011 Nicira, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
int check_connection_completion(int fd);
int drain_rcvbuf(int fd);
void drain_fd(int fd, size_t n_packets);
-int make_unix_socket(int style, bool nonblock, bool passcred,
+int make_unix_socket(int style, bool nonblock,
const char *bind_path, const char *connect_path);
int get_unix_name_len(socklen_t sun_len);
ovs_be32 guess_netmask(ovs_be32 ip);
const char *connect_path = suffix;
int fd;
- fd = make_unix_socket(SOCK_STREAM, true, false, NULL, connect_path);
+ fd = make_unix_socket(SOCK_STREAM, true, NULL, connect_path);
if (fd < 0) {
VLOG_ERR("%s: connection failed (%s)", connect_path, strerror(-fd));
return -fd;
{
int fd, error;
- fd = make_unix_socket(SOCK_STREAM, true, true, suffix, NULL);
+ fd = make_unix_socket(SOCK_STREAM, true, suffix, NULL);
if (fd < 0) {
VLOG_ERR("%s: binding failed: %s", suffix, strerror(errno));
return errno;
/*
- * Copyright (c) 2010 Nicira, Inc.
+ * Copyright (c) 2010, 2012 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
alarm(5);
/* Create a listening socket under name 'sockname1'. */
- sock1 = make_unix_socket(SOCK_STREAM, false, false, sockname1, NULL);
+ sock1 = make_unix_socket(SOCK_STREAM, false, sockname1, NULL);
if (sock1 < 0) {
ovs_fatal(-sock1, "%s: bind failed", sockname1);
}
/* Connect to 'sockname2' (which should be the same file, perhaps under a
* different name). */
- sock2 = make_unix_socket(SOCK_STREAM, false, false, NULL, sockname2);
+ sock2 = make_unix_socket(SOCK_STREAM, false, NULL, sockname2);
if (sock2 < 0) {
ovs_fatal(-sock2, "%s: connect failed", sockname2);
}