From patchwork Tue Mar 6 22:48:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amos Kong X-Patchwork-Id: 145054 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 827DBB6EEA for ; Wed, 7 Mar 2012 10:05:25 +1100 (EST) Received: from localhost ([::1]:50092 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S53Bu-0004xs-PZ for incoming@patchwork.ozlabs.org; Tue, 06 Mar 2012 17:49:10 -0500 Received: from eggs.gnu.org ([208.118.235.92]:43785) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S53Be-0004dY-HK for qemu-devel@nongnu.org; Tue, 06 Mar 2012 17:48:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S53Bc-0005ra-Ff for qemu-devel@nongnu.org; Tue, 06 Mar 2012 17:48:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:14464) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S53Bc-0005qj-7U for qemu-devel@nongnu.org; Tue, 06 Mar 2012 17:48:52 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q26Mmolp012560 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 6 Mar 2012 17:48:50 -0500 Received: from dhcp-8-167.nay.redhat.com (dhcp-8-167.nay.redhat.com [10.66.8.167]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q26Mmlmg027099; Tue, 6 Mar 2012 17:48:48 -0500 To: aliguori@us.ibm.com, kvm@vger.kernel.org, quintela@redhat.com, jasowang@redhat.com, qemu-devel@nongnu.org, owasserm@redhat.com, laine@redhat.com From: Amos Kong Date: Wed, 07 Mar 2012 06:48:48 +0800 Message-ID: <20120306224848.24264.53905.stgit@dhcp-8-167.nay.redhat.com> In-Reply-To: <20120306224330.24264.9494.stgit@dhcp-8-167.nay.redhat.com> References: <20120306224330.24264.9494.stgit@dhcp-8-167.nay.redhat.com> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 8/9] net: split hostname and service by last colon 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 IPv6 address contains colons, parse will be wrong. [2312::8274]:5200 Signed-off-by: Amos Kong --- net.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net.c b/net.c index 2518e5f..d6ce1fa 100644 --- a/net.c +++ b/net.c @@ -84,7 +84,7 @@ static int get_str_sep(char *buf, int buf_size, const char **pp, int sep) const char *p, *p1; int len; p = *pp; - p1 = strchr(p, sep); + p1 = strrchr(p, sep); if (!p1) return -1; len = p1 - p;