projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
netdev: Implement an abstract interface to network devices.
[openvswitch]
/
lib
/
vconn-unix.c
diff --git
a/lib/vconn-unix.c
b/lib/vconn-unix.c
index fddf6e85185c6e6a7394bcd6455cf8d55c651d3c..93d14e831ccb39db6494c137366f81d3cea56a61 100644
(file)
--- a/
lib/vconn-unix.c
+++ b/
lib/vconn-unix.c
@@
-60,7
+60,7
@@
unix_open(const char *name, char *suffix, struct vconn **vconnp)
}
return new_stream_vconn(name, fd, check_connection_completion(fd),
}
return new_stream_vconn(name, fd, check_connection_completion(fd),
-
0, 0, true, NULL
, vconnp);
+
true
, vconnp);
}
struct vconn_class unix_vconn_class = {
}
struct vconn_class unix_vconn_class = {
@@
-81,7
+81,7
@@
static int punix_accept(int fd, const struct sockaddr *sa, size_t sa_len,
static int
punix_open(const char *name UNUSED, char *suffix, struct pvconn **pvconnp)
{
static int
punix_open(const char *name UNUSED, char *suffix, struct pvconn **pvconnp)
{
- int fd;
+ int fd
, error
;
fd = make_unix_socket(SOCK_STREAM, true, true, suffix, NULL);
if (fd < 0) {
fd = make_unix_socket(SOCK_STREAM, true, true, suffix, NULL);
if (fd < 0) {
@@
-89,6
+89,19
@@
punix_open(const char *name UNUSED, char *suffix, struct pvconn **pvconnp)
return errno;
}
return errno;
}
+ error = set_nonblocking(fd);
+ if (error) {
+ close(fd);
+ return error;
+ }
+
+ if (listen(fd, 10) < 0) {
+ error = errno;
+ VLOG_ERR("%s: listen: %s", name, strerror(error));
+ close(fd);
+ return error;
+ }
+
return new_pstream_pvconn("punix", fd, punix_accept, pvconnp);
}
return new_pstream_pvconn("punix", fd, punix_accept, pvconnp);
}
@@
-105,7
+118,7
@@
punix_accept(int fd, const struct sockaddr *sa, size_t sa_len,
} else {
strcpy(name, "unix");
}
} else {
strcpy(name, "unix");
}
- return new_stream_vconn(name, fd, 0,
0, 0, true, NULL
, vconnp);
+ return new_stream_vconn(name, fd, 0,
true
, vconnp);
}
struct pvconn_class punix_pvconn_class = {
}
struct pvconn_class punix_pvconn_class = {