[gdm-list] [PATCH] fix indirect xdmcp with ipv6



Hi,

Selecting a host in the chooser caused an assertion in gdm because
it called gdm_xdmcp_send_forward_query also for IPv6 addresses.

cu
Ludwig

Index: gdm2/daemon/xdmcp.c
===================================================================
--- gdm2.orig/daemon/xdmcp.c
+++ gdm2/daemon/xdmcp.c
@@ -755,11 +755,23 @@ gdm_xdmcp_handle_query (struct sockaddr_
 					list = list->next;
 				}
 			} else {
-				/* or send forward query to chosen host */
-				gdm_xdmcp_send_forward_query
-					(id, (struct sockaddr_in *)clnt_sa,
-					 &(((struct sockaddr_in *)clnt_sa)->sin_addr),
-					 &clnt_authlist);
+#ifdef ENABLE_IPV6
+				if(clnt_sa->ss_family == AF_INET6)
+				{
+					gdm_xdmcp_send_forward_query6
+						(id, (struct sockaddr_in6 *)clnt_sa,
+						 &(((struct sockaddr_in6 *)clnt_sa)->sin6_addr),
+						 &clnt_authlist);
+				}
+				else
+#endif
+				{
+					/* or send forward query to chosen host */
+					gdm_xdmcp_send_forward_query
+						(id, (struct sockaddr_in *)clnt_sa,
+						 &(((struct sockaddr_in *)clnt_sa)->sin_addr),
+						 &clnt_authlist);
+				}
 			}
 		} else if (id == NULL) {
 			id = gdm_choose_indirect_alloc (clnt_sa);
@@ -794,7 +806,7 @@ gdm_xdmcp_send_forward_query6 (GdmIndire
 	char buffer6[INET6_ADDRSTRLEN];
 
 	g_assert (id != NULL);
-	g_assert (id->chosen_host != NULL);
+	g_assert (id->chosen_host6 != NULL);
 
 	gdm_debug ("gdm_xdmcp_send_forward_query6: Sending forward query to %s", inet_ntop (AF_INET6, &(id->chosen_host6), buffer6, sizeof (buffer6)));
 	gdm_debug ("gdm_xdmcp_send_forward_query6: Query contains %s:%d", inet_ntop (AF_INET6, display_addr, buffer6, sizeof (buffer6)), (int) ntohs (clnt_sa->sin6_port));

-- 
 (o_   Ludwig Nussel
 //\   SUSE LINUX Products GmbH, Development
 V_/_  http://www.suse.de/




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