From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDxlX-0007rt-Iy for qemu-devel@nongnu.org; Tue, 18 Sep 2012 09:23:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TDxlR-0003UG-OY for qemu-devel@nongnu.org; Tue, 18 Sep 2012 09:23:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40673) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDxlR-0003UC-Gr for qemu-devel@nongnu.org; Tue, 18 Sep 2012 09:22:57 -0400 Message-ID: <5058759C.50207@redhat.com> Date: Tue, 18 Sep 2012 15:22:36 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <20120917152149.GB6879@in.ibm.com> <20120917152343.GD6879@in.ibm.com> In-Reply-To: <20120917152343.GD6879@in.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v7 2/5] sockets: Change inet_parse() to accept address specification without port List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: bharata@linux.vnet.ibm.com Cc: Anthony Liguori , Anand Avati , Vijay Bellur , Stefan Hajnoczi , Amar Tumballi , qemu-devel@nongnu.org, Markus Armbruster , Blue Swirl , Avi Kivity , Paolo Bonzini Am 17.09.2012 17:23, schrieb Bharata B Rao: > sockets: Change inet_parse() to accept address specification without port > > From: Bharata B Rao > > inet_parse() expects address:port. Change it to work without explicit port > specification. In addition, don't depend solely on the return value of Things like "in addition" in a commit message are almost always a sign that the patch should be split in two. > sscanf but also consider the value obtained for %n directive used in sscanf. > This ensures that the scanning of malformed inet address isn't flagged as > success. Can you give an example string that would be falsely accepted? To me the old checks look fine (even though the new ones are a little bit easier to read, so even if they don't fix anything, they might be worth doing). Anyway, it does look correct. Kevin