Blob Blame History Raw
From c5c4b2f5535977b0aec7567cfb016a5419d65873 Mon Sep 17 00:00:00 2001
From: Pavel Grunt <pgrunt@redhat.com>
Date: Tue, 21 Jun 2016 15:13:31 +0200
Subject: [PATCH 17/17] session: Keep brackets around ipv6 hostname
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

According to rfc2732:
"To use a literal IPv6 address in a URL, the literal address should be
enclosed in "[" and "]" characters."

Resolves: rhbz#1331777

Acked-by: Marc-André Lureau <mlureau@redhat.com>
(cherry picked from commit ea37f06eaa11b6307c797895aeb85d87d142625a)
---
 src/spice-session.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/spice-session.c b/src/spice-session.c
index f77487a..cc4b614 100644
--- a/src/spice-session.c
+++ b/src/spice-session.c
@@ -479,7 +479,7 @@ static int spice_parse_uri(SpiceSession *session, const char *original_uri)
         }
         tmp[0] = '\0';
         tmp++;
-        host = g_strdup(authority + 1);
+        host = g_strdup_printf("[%s]", authority + 1);
         if (tmp[0] == ':')
             port = g_strdup(tmp + 1);
     } else {
-- 
2.9.0