From: Ben Pfaff Date: Tue, 6 Dec 2011 23:57:15 +0000 (-0800) Subject: socket-util: Don't try to listen to a UDP socket. X-Git-Tag: sliver-openvswitch-0.1-1~552 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=041dc07fd21b6987ffbcc6a597eb9918d44ae841;p=sliver-openvswitch.git 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 --- 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;