2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00

socket-util: Don't try to listen to a UDP socket.

The "listen" system call doesn't work and isn't necessary for UDP, but
inet_open_passive() would still try to call it (and fail).

This doesn't fix a real bug because the two existing callers both use
inet_open_passive() to listen for TCP connections.

Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Ben Pfaff
2011-12-06 15:57:15 -08:00
parent 02e83e83b4
commit 041dc07fd2

View File

@@ -702,7 +702,7 @@ inet_open_passive(int style, const char *target, int default_port,
}
/* 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;