[ovs-dev] [PATCH 5/5] socket-util: Log the kernel assigned port number when asked.

Ben Pfaff blp at nicira.com
Wed May 28 00:12:23 UTC 2014

On Mon, May 19, 2014 at 12:52:26PM -0700, Gurucharan Shetty wrote:
> So far, we log the kernel assigned port number when the port number is
> not specified. On Windows, this happens multiple times because "unix"
> sockets are implemented internally via TCP ports. This means that many tests,
> specially the ovs-ofctl monitor tests, need to filter out the
> additional messages. Doing that is not a big deal, but I think it will
> keep manifesting in future tests added by Linux developers.
> With this commit, we simply don't print the kernel assigned TCP ports
> on windows when done for "unix" sockets.
> Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>

new_pstream() looks like it has two callers with similar code:
    fd = inet_open_passive(SOCK_STREAM, suffix, -1, &ss, dscp, true);
    if (fd < 0) {
        return -fd;

    return new_pstream(fd, &ss, pstreamp);
    fd = inet_open_passive(SOCK_STREAM, suffix_new, -1, &ss, dscp, false);
    if (fd < 0) {
        return -fd;

    error = new_pstream(fd, &ss, pstreamp);
    if (error) {
        goto exit;

Can we move the inet_open_passive() call into new_pstream() and add a
kernel_print_port parameter to new_pstream()?

Acked-by: Ben Pfaff <blp at nicira.com>

More information about the dev mailing list