All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Peter Krempa <pkrempa@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] util: socket: Add missing localaddr and localport option for DGRAM socket
Date: Wed, 13 May 2015 20:23:34 +0200	[thread overview]
Message-ID: <87d224fiah.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <9f24c75fdb3b0bf78f5dc72fc50791649115410e.1431527124.git.pkrempa@redhat.com> (Peter Krempa's message of "Wed, 13 May 2015 16:44:38 +0200")

Peter Krempa <pkrempa@redhat.com> writes:

> The 'socket_optslist' structure does not contain the 'localaddr' and
> 'localport' options that are parsed in case you are creating a
> 'connect' type UDP character device. This causes abort of qemu after
> commit:
>
> commit f43e47dbf6de24db20ec9b588bb6cc762093dd69
> Author: Markus Armbruster <armbru@redhat.com>
> Date:   Thu Feb 12 17:52:20 2015 +0100
>
>     QemuOpts: Drop qemu_opt_set(), rename qemu_opt_set_err(), fix use
>
> Add the two fields so that the options can again be parsed correctly.
>
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1220252
>
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>

I fished the reproducer out of Bugzilla:

    $ qemu-system-x86_64 -chardev udp,id=charrng0,host=127.0.0.1,port=1234,localaddr=,localport=1234
    qemu-system-x86_64: -chardev udp,id=charrng0,host=127.0.0.1,port=1234,localaddr=,localport=1234: Invalid parameter 'localaddr'
    Aborted (core dumped)

Please include it in the commit message next time.

Before commit f43e47d, errors are reported and ignored instead:

    qemu-system-x86_64: -chardev udp,id=charrng0,host=127.0.0.1,port=1234,localaddr=,localport=1234: Invalid parameter 'localaddr'
    qemu-system-x86_64: -chardev udp,id=charrng0,host=127.0.0.1,port=1234,localaddr=,localport=1234: Invalid parameter 'localport'

When inet_dgram_opts() tries to retrieve them, it gets NULL, and duly
assumes default values: wildcard address, port 0.  bind() then binds a
port chosen by the kernel on all interfaces.

Specifying a localaddr other than "" or a localport other than 0 does
not work.

The commit you quoted didn't break it, it only made existing breakage
more obvious.

Do you have an idea when this was broken?  Assuming it ever worked...

      parent reply	other threads:[~2015-05-13 18:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-13 14:44 [Qemu-devel] [PATCH] util: socket: Add missing localaddr and localport option for DGRAM socket Peter Krempa
2015-05-13 16:55 ` Eric Blake
2015-05-13 18:23 ` Markus Armbruster [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d224fiah.fsf@blackfin.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=pkrempa@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.