[ovs-dev] [flow-stats 04/14] socket-util: Don't try to listen to a UDP socket.

Ethan Jackson ethan at nicira.com
Tue Dec 13 21:49:28 UTC 2011


Looks good.

Ethan

On Thu, Dec 8, 2011 at 14:01, Ben Pfaff <blp at nicira.com> wrote:
> 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.
> ---
>  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 219433f..12f0432 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;
> --
> 1.7.4.4
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev



More information about the dev mailing list