diff options
author | Ben Pfaff <blp@nicira.com> | 2011-12-06 15:57:15 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2011-12-19 14:53:31 -0800 |
commit | 041dc07fd21b6987ffbcc6a597eb9918d44ae841 (patch) | |
tree | 04062b77afcdff32e2865a458c6be5fe69e56bd6 /lib/socket-util.c | |
parent | 02e83e83b4c8d88f50317ba56fec53cd6d3fb909 (diff) | |
download | openvswitch-041dc07fd21b6987ffbcc6a597eb9918d44ae841.tar.gz |
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>
Diffstat (limited to 'lib/socket-util.c')
-rw-r--r-- | lib/socket-util.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/socket-util.c b/lib/socket-util.c index 219433fb8..12f04321b 100644 --- a/lib/socket-util.c +++ b/lib/socket-util.c @@ -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; |