[vinagre] Accept IPv6 addresses
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vinagre] Accept IPv6 addresses
- Date: Fri, 25 Sep 2015 11:36:59 +0000 (UTC)
commit 1b2df81a539dbdb629466cd1f670545d1b4768d6
Author: Manuel Bachmann <manuel bachmann iot bzh>
Date: Thu Sep 24 23:43:33 2015 +0200
Accept IPv6 addresses
We now accept entering IPv6 address in the "host" field directly; using
a hostname or alias for IPv6-only servers is no longer required.
https://bugzilla.gnome.org/show_bug.cgi?id=710173
Signed-off-by: Manuel Bachmann <manuel bachmann iot bzh>
vinagre/vinagre-connection.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/vinagre/vinagre-connection.c b/vinagre/vinagre-connection.c
index 3a3b9ac..812ae92 100644
--- a/vinagre/vinagre-connection.c
+++ b/vinagre/vinagre-connection.c
@@ -582,6 +582,7 @@ vinagre_connection_split_string (const gchar *uri,
gchar **server, **url;
gint lport;
gchar *lhost;
+ gboolean is_ipv6;
gchar ipv6_host[255] = {0,};
VinagreProtocol *ext;
@@ -618,6 +619,11 @@ vinagre_connection_split_string (const gchar *uri,
return FALSE;
}
+ is_ipv6 = g_strstr_len (lhost, -1, ":") != NULL;
+
+ if (is_ipv6)
+ lhost = g_strconcat ("[", lhost, "]", NULL);
+
if (lhost[0] == '[')
{
int i;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]