From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55294) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmkGf-0005xK-HN for qemu-devel@nongnu.org; Mon, 27 Apr 2015 10:44:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YmkGZ-0005ac-Ee for qemu-devel@nongnu.org; Mon, 27 Apr 2015 10:44:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48232) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmkGZ-0005Zv-7V for qemu-devel@nongnu.org; Mon, 27 Apr 2015 10:44:11 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t3REi93V031768 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 27 Apr 2015 10:44:09 -0400 Message-ID: <553E4B38.9000604@redhat.com> Date: Mon, 27 Apr 2015 08:44:08 -0600 From: Eric Blake MIME-Version: 1.0 References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="pDO4jMh0SUgUaUie62ccTbNBUKcW3TD6M" Subject: Re: [Qemu-devel] [PATCH] Strip brackets from vnc host List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?SsOhbiBUb21rbw==?= , qemu-devel@nongnu.org Cc: kraxel@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --pDO4jMh0SUgUaUie62ccTbNBUKcW3TD6M Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 04/27/2015 06:06 AM, J=C3=A1n Tomko wrote: > Commit v2.2.0-1530-ge556032 vnc: switch to inet_listen_opts > bypassed the use of inet_parse in inet_listen, making literal > IPv6 addresses enclosed in brackets fail: >=20 > qemu-kvm: -vnc [::1]:0: Failed to start VNC server on `(null)': address= > resolution failed for [::1]:5900: Name or service not known >=20 > Strip the brackets to make it work again. >=20 > Signed-off-by: J=C3=A1n Tomko > --- > ui/vnc.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) >=20 > diff --git a/ui/vnc.c b/ui/vnc.c > index cffb5b7..49af7c7 100644 > --- a/ui/vnc.c > +++ b/ui/vnc.c > @@ -3482,7 +3482,14 @@ void vnc_display_open(const char *id, Error **er= rp) > =20 > h =3D strrchr(vnc, ':'); > if (h) { > - char *host =3D g_strndup(vnc, h - vnc); > + char *host; > + size_t hlen =3D h - vnc; > + > + if (vnc[0] =3D=3D '[' && vnc[hlen-1] =3D=3D ']') { > + host =3D g_strndup(vnc+1, hlen - 2); Inconsistent spacing around operators (2 of the three '-'/'+' are missing spacing). With that fixed, Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --pDO4jMh0SUgUaUie62ccTbNBUKcW3TD6M Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVPks4AAoJEKeha0olJ0Nqil0H/2/URuSeJHNouM3T5KDkXQOM /vKcvfvw8cAzHoqRqfQliuMs42QK4dPLZEY0w7mBgIgAmphnZZyYoGawQCao08FL SUd/2gZsvJ2IdY7wvmdXL9fON3zbrURHVckJ3omLkp1goq9pBkc4x66dASiQaWst WTkZbSH2pCViBfvrG3TVOdL2fj+8QQzrlvHxA3IpoWGnOV9S0Fbtjr00PUTXVhKh bQ9x+LK7HnfVSVdvPN4Bj+Yx5mD8Eu+PXP8D3In1B/4TWgy8hGnUrzttGdoBCHB1 N5yAXElHA0khYJoyFiCkCCmFgD6Y/wahUCeQM0rwdyKaFIO25vuQDGUQud3z1UA= =c8Tg -----END PGP SIGNATURE----- --pDO4jMh0SUgUaUie62ccTbNBUKcW3TD6M--