From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:32903) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7XhB-0003Zp-DA for qemu-devel@nongnu.org; Tue, 13 Mar 2012 15:47:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S7Xh9-0004RO-Je for qemu-devel@nongnu.org; Tue, 13 Mar 2012 15:47:44 -0400 Received: from mail-yx0-f173.google.com ([209.85.213.173]:61633) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7Xh9-0004RB-Cm for qemu-devel@nongnu.org; Tue, 13 Mar 2012 15:47:43 -0400 Received: by yenr5 with SMTP id r5so1096429yen.4 for ; Tue, 13 Mar 2012 12:47:41 -0700 (PDT) Sender: fluxion Date: Tue, 13 Mar 2012 14:47:35 -0500 From: Michael Roth Message-ID: <20120313194735.GE3699@illuin> References: <20120306224330.24264.9494.stgit@dhcp-8-167.nay.redhat.com> <20120306224857.24264.88329.stgit@dhcp-8-167.nay.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120306224857.24264.88329.stgit@dhcp-8-167.nay.redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 9/9] net: support to include ipv6 address by brackets List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amos Kong Cc: aliguori@us.ibm.com, kvm@vger.kernel.org, quintela@redhat.com, jasowang@redhat.com, qemu-devel@nongnu.org, owasserm@redhat.com, laine@redhat.com On Wed, Mar 07, 2012 at 06:48:57AM +0800, Amos Kong wrote: > That method of representing an IPv6 address with a port is I'm not sure what "that" is referencing. I assumed the previous patch but the representation seems to be the same? > discouraged because of its ambiguity. Referencing to RFC5952, > the recommended format is: > > [2312::8274]:5200 > > For IPv6 brackets must be mandatory if you require a port. > > test status: Successed > listen side: qemu-kvm .... -incoming tcp:[2312::8274]:5200 > client side: qemu-kvm ... > (qemu) migrate -d tcp:[2312::8274]:5200 > > Signed-off-by: Amos Kong > --- > net.c | 6 ++++++ > 1 files changed, 6 insertions(+), 0 deletions(-) > > diff --git a/net.c b/net.c > index d6ce1fa..499ed1d 100644 > --- a/net.c > +++ b/net.c > @@ -88,6 +88,12 @@ static int get_str_sep(char *buf, int buf_size, const char **pp, int sep) > if (!p1) > return -1; > len = p1 - p; > + /* remove brackets which includes hostname */ > + if (*p == '[' && *(p1-1) == ']') { > + p += 1; > + len -= 2; > + } Sorry, looking again I guess net/slirp.c actually has it's own copy of get_str_sep(), so modifying this doesn't look like it would break anything currently. It might cause some confusion though :). And I think the special handling for brackets should be done in parse_host_port_info() since get_str_sep() is pretty generically named. > + > p1++; > if (buf_size > 0) { > if (len > buf_size - 1) > >