Peter Krempa <[email protected]> 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 <[email protected]>
> 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 <[email protected]>
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...