From patchwork Wed Nov 21 07:14:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: malc X-Patchwork-Id: 200592 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E055E2C008A for ; Wed, 21 Nov 2012 18:14:47 +1100 (EST) Received: from localhost ([::1]:39449 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tb4WE-0001rQ-0C for incoming@patchwork.ozlabs.org; Wed, 21 Nov 2012 02:14:46 -0500 Received: from eggs.gnu.org ([208.118.235.92]:45369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tb4W4-0001rE-IM for qemu-devel@nongnu.org; Wed, 21 Nov 2012 02:14:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tb4W3-0008TV-Hi for qemu-devel@nongnu.org; Wed, 21 Nov 2012 02:14:36 -0500 Received: from fe02x03-cgp.akado.ru ([77.232.31.165]:57661 helo=akado.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tb4W3-0008TG-Ad for qemu-devel@nongnu.org; Wed, 21 Nov 2012 02:14:35 -0500 Received: from [10.0.66.9] ([10.0.66.9] verified) by fe02-cgp.akado.ru (CommuniGate Pro SMTP 5.2.13) with ESMTPS id 293972091; Wed, 21 Nov 2012 11:14:32 +0400 Date: Wed, 21 Nov 2012 11:14:21 +0400 (MSK) From: malc X-X-Sender: malc@linmac To: qemu-devel@nongnu.org Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: FreeBSD 8.x X-Received-From: 77.232.31.165 Cc: Paolo Bonzini Subject: [Qemu-devel] 879e45c72da1569e07fbbc6a1aa2a708ea796044 breakage X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Commit in the subject broke inet parsing (noticed by a build on a remote system without X and only internal vnc server that by default uses localhost:0,to=99), following was probably intended, but you're never sure: addr->ipv4 = addr->has_ipv4 = true; diff --git a/qemu-sockets.c b/qemu-sockets.c index cfed9c5..e7272c8 100644 --- a/qemu-sockets.c +++ b/qemu-sockets.c @@ -529,13 +529,15 @@ static InetSocketAddress *inet_parse(const char *str, Error **errp) optstr = str + pos; h = strstr(optstr, ",to="); if (h) { - if (1 != sscanf(str, "%d%n", &to, &pos) || - (str[pos] != '\0' && str[pos] != ',')) { + h += 4; + if (1 != sscanf(h, "%d%n", &to, &pos) || + (h[pos] != '\0' && h[pos] != ',')) { error_setg(errp, "error parsing to= argument"); goto fail; } addr->has_to = true; addr->to = to; + optstr = h + pos; } if (strstr(optstr, ",ipv4")) {