--- vinagre/vinagre-connection.c	2013-10-15 10:48:09.042409920 +0200
+++ vinagre/vinagre-connection.c	2013-10-15 10:54:20.308446652 +0200
@@ -493,6 +493,7 @@
   gchar **server, **url;
   gint    lport;
   gchar  *lhost;
+  gboolean is_ipv6 = NULL;
   gchar   ipv6_host[255] = {0,};
   VinagreProtocol *ext;
 
@@ -529,6 +530,10 @@
       return FALSE;
     }
 
+  is_ipv6 = g_strstr_len (lhost, -1, ":");
+  if (is_ipv6)
+    lhost = g_strconcat (g_strdup ("["), g_strdup (lhost), g_strdup ("]"), NULL);
+
   if (lhost[0] == '[')
     {
       int i;
@@ -667,12 +672,12 @@
 {
   GString *uri;
   gchar *result;
-  gboolean is_ipv6;
+  gboolean is_ipv6 = NULL;
   VinagreProtocol *ext;
 
   g_return_val_if_fail (VINAGRE_IS_CONNECTION (conn), NULL);
 
-  is_ipv6 = g_strstr_len (conn->priv->host, -1, ":") != NULL;
+  is_ipv6 = g_strstr_len (conn->priv->host, -1, ":");
 
   if (has_protocol)
     {
