From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsbJl-0006x2-KH for qemu-devel@nongnu.org; Wed, 13 May 2015 14:23:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YsbJi-0004Uw-EF for qemu-devel@nongnu.org; Wed, 13 May 2015 14:23:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45926) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsbJi-0004Uh-6q for qemu-devel@nongnu.org; Wed, 13 May 2015 14:23:38 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t4DINaRu029414 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 13 May 2015 14:23:37 -0400 From: Markus Armbruster References: <9f24c75fdb3b0bf78f5dc72fc50791649115410e.1431527124.git.pkrempa@redhat.com> Date: Wed, 13 May 2015 20:23:34 +0200 In-Reply-To: <9f24c75fdb3b0bf78f5dc72fc50791649115410e.1431527124.git.pkrempa@redhat.com> (Peter Krempa's message of "Wed, 13 May 2015 16:44:38 +0200") Message-ID: <87d224fiah.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] util: socket: Add missing localaddr and localport option for DGRAM socket List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Krempa Cc: qemu-devel@nongnu.org Peter Krempa 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 > 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 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...