[gdm/gnome-2-30] Fix bugzilla 627428 and strip ::ffff: in front of IPv4 addresses This fixes XDMCP using IPv4 on IPv6



commit a2fe5714cce0d58f901df25fdbf43920f615ff51
Author: Brian Cameron <brian cameron oracle com>
Date:   Thu Apr 7 11:54:53 2011 -0500

    Fix bugzilla 627428 and strip ::ffff: in front of IPv4 addresses
    This fixes XDMCP using IPv4 on IPv6-enabled networks.

 common/gdm-address.c                         |   12 ++++++++++--
 daemon/gdm-xdmcp-display-factory.c           |    2 +-
 gui/simple-chooser/gdm-host-chooser-widget.c |    2 +-
 3 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/common/gdm-address.c b/common/gdm-address.c
index dc9e8b3..a39724f 100644
--- a/common/gdm-address.c
+++ b/common/gdm-address.c
@@ -330,10 +330,18 @@ gdm_address_get_numeric_info (GdmAddress *address,
         }
 
         if (servp != NULL) {
-                *servp = g_strdup (serv);
+                if (g_str_has_prefix (serv, "::ffff:")) {
+                        *servp = g_strdup (serv + 7);
+                } else {
+                        *servp = g_strdup (serv);
+                }
         }
         if (hostp != NULL) {
-                *hostp = g_strdup (host);
+                if (g_str_has_prefix (host, "::ffff:")) {
+                        *hostp = g_strdup (host + 7);
+                } else {
+                        *hostp = g_strdup (host);
+                }
         }
 
         return ret;
diff --git a/daemon/gdm-xdmcp-display-factory.c b/daemon/gdm-xdmcp-display-factory.c
index 06fafae..f62fdfb 100644
--- a/daemon/gdm-xdmcp-display-factory.c
+++ b/daemon/gdm-xdmcp-display-factory.c
@@ -2889,7 +2889,7 @@ decode_packet (GIOChannel             *source,
                 return TRUE;
         }
 
-        ss_len = (int)gdm_sockaddr_len (&clnt_ss);
+        ss_len = (int) sizeof (clnt_ss);
 
         res = XdmcpFill (factory->priv->socket_fd, &factory->priv->buf, (XdmcpNetaddr)&clnt_ss, &ss_len);
         if G_UNLIKELY (! res) {
diff --git a/gui/simple-chooser/gdm-host-chooser-widget.c b/gui/simple-chooser/gdm-host-chooser-widget.c
index 352c1e2..3e8a2e2 100644
--- a/gui/simple-chooser/gdm-host-chooser-widget.c
+++ b/gui/simple-chooser/gdm-host-chooser-widget.c
@@ -208,7 +208,7 @@ decode_packet (GIOChannel           *source,
                 return TRUE;
         }
 
-        ss_len = (int)gdm_sockaddr_len (&clnt_ss);
+        ss_len = (int) sizeof (clnt_ss);
 
         res = XdmcpFill (widget->priv->socket_fd, &buf, (XdmcpNetaddr)&clnt_ss, &ss_len);
         if G_UNLIKELY (! res) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]