projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ovsdb-data: Short-circuit ovsdb_datum_includes_all() in trivial case.
[openvswitch]
/
lib
/
socket-util.c
diff --git
a/lib/socket-util.c
b/lib/socket-util.c
index 26e290815cbf2e4856a53ca7fa33016453bdc818..12f04321beb9df16b6097f9be3295eec2ff683f8 100644
(file)
--- a/
lib/socket-util.c
+++ b/
lib/socket-util.c
@@
-673,7
+673,7
@@
inet_open_passive(int style, const char *target, int default_port,
unsigned int yes = 1;
if (!inet_parse_passive(target, default_port, &sin)) {
unsigned int yes = 1;
if (!inet_parse_passive(target, default_port, &sin)) {
- return EAFNOSUPPORT;
+ return
-
EAFNOSUPPORT;
}
/* Create non-blocking socket, set SO_REUSEADDR. */
}
/* Create non-blocking socket, set SO_REUSEADDR. */
@@
-681,7
+681,7
@@
inet_open_passive(int style, const char *target, int default_port,
if (fd < 0) {
error = errno;
VLOG_ERR("%s: socket: %s", target, strerror(error));
if (fd < 0) {
error = errno;
VLOG_ERR("%s: socket: %s", target, strerror(error));
- return error;
+ return
-
error;
}
error = set_nonblocking(fd);
if (error) {
}
error = set_nonblocking(fd);
if (error) {
@@
-702,7
+702,7
@@
inet_open_passive(int style, const char *target, int default_port,
}
/* Listen. */
}
/* Listen. */
- if (listen(fd, 10) < 0) {
+ if (
style == SOCK_STREAM &&
listen(fd, 10) < 0) {
error = errno;
VLOG_ERR("%s: listen: %s", target, strerror(error));
goto error;
error = errno;
VLOG_ERR("%s: listen: %s", target, strerror(error));
goto error;
@@
-716,6
+716,7
@@
inet_open_passive(int style, const char *target, int default_port,
goto error;
}
if (sin.sin_family != AF_INET || sin_len != sizeof sin) {
goto error;
}
if (sin.sin_family != AF_INET || sin_len != sizeof sin) {
+ error = EAFNOSUPPORT;
VLOG_ERR("%s: getsockname: invalid socket name", target);
goto error;
}
VLOG_ERR("%s: getsockname: invalid socket name", target);
goto error;
}
@@
-726,7
+727,7
@@
inet_open_passive(int style, const char *target, int default_port,
error:
close(fd);
error:
close(fd);
- return error;
+ return
-
error;
}
/* Returns a readable and writable fd for /dev/null, if successful, otherwise
}
/* Returns a readable and writable fd for /dev/null, if successful, otherwise