[BACK]Return to patch-ap CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / x11 / gdm / patches

File: [cvs.NetBSD.org] / pkgsrc / x11 / gdm / patches / patch-ap (download)

Revision 1.3, Tue Apr 7 11:40:20 2009 UTC (10 years, 10 months ago) by drochner
Branch: MAIN
CVS Tags: pkgsrc-2019Q4-base, pkgsrc-2019Q4, pkgsrc-2019Q3-base, pkgsrc-2019Q3, pkgsrc-2019Q2-base, pkgsrc-2019Q2, pkgsrc-2019Q1-base, pkgsrc-2019Q1, pkgsrc-2018Q4-base, pkgsrc-2018Q4, pkgsrc-2018Q3-base, pkgsrc-2018Q3, pkgsrc-2018Q2-base, pkgsrc-2018Q2, pkgsrc-2018Q1-base, pkgsrc-2018Q1, pkgsrc-2017Q4-base, pkgsrc-2017Q4, pkgsrc-2017Q3-base, pkgsrc-2017Q3, pkgsrc-2017Q2-base, pkgsrc-2017Q2, pkgsrc-2017Q1-base, pkgsrc-2017Q1, pkgsrc-2016Q4-base, pkgsrc-2016Q4, pkgsrc-2016Q3-base, pkgsrc-2016Q3, pkgsrc-2016Q2-base, pkgsrc-2016Q2, pkgsrc-2016Q1-base, pkgsrc-2016Q1, pkgsrc-2015Q4-base, pkgsrc-2015Q4, pkgsrc-2015Q3-base, pkgsrc-2015Q3, pkgsrc-2015Q2-base, pkgsrc-2015Q2, pkgsrc-2015Q1-base, pkgsrc-2015Q1, pkgsrc-2014Q4-base, pkgsrc-2014Q4, pkgsrc-2014Q3-base, pkgsrc-2014Q3, pkgsrc-2014Q2-base, pkgsrc-2014Q2, pkgsrc-2014Q1-base, pkgsrc-2014Q1, pkgsrc-2013Q4-base, pkgsrc-2013Q4, pkgsrc-2013Q3-base, pkgsrc-2013Q3, pkgsrc-2013Q2-base, pkgsrc-2013Q2, pkgsrc-2013Q1-base, pkgsrc-2013Q1, pkgsrc-2012Q4-base, pkgsrc-2012Q4, pkgsrc-2012Q3-base, pkgsrc-2012Q3, pkgsrc-2012Q2-base, pkgsrc-2012Q2, pkgsrc-2012Q1-base, pkgsrc-2012Q1, pkgsrc-2011Q4-base, pkgsrc-2011Q4, pkgsrc-2011Q3-base, pkgsrc-2011Q3, pkgsrc-2011Q2-base, pkgsrc-2011Q2, pkgsrc-2011Q1-base, pkgsrc-2011Q1, pkgsrc-2010Q4-base, pkgsrc-2010Q4, pkgsrc-2010Q3-base, pkgsrc-2010Q3, pkgsrc-2010Q2-base, pkgsrc-2010Q2, pkgsrc-2010Q1-base, pkgsrc-2010Q1, pkgsrc-2009Q4-base, pkgsrc-2009Q4, pkgsrc-2009Q3-base, pkgsrc-2009Q3, pkgsrc-2009Q2-base, pkgsrc-2009Q2, HEAD
Changes since 1.2: +4 -4 lines

update to 2.20.10
changes:
-bugfixes
-translation updates
-portability improvements

$NetBSD: patch-ap,v 1.3 2009/04/07 11:40:20 drochner Exp $

--- ./daemon/gdm-xdmcp-manager.c.orig	2009-03-19 05:59:27.000000000 +0100
+++ ./daemon/gdm-xdmcp-manager.c
@@ -64,7 +64,7 @@
  * On Sun, we need to define allow_severity and deny_severity to link
  * against libwrap.
  */
-#ifdef __sun
+#if defined(__sun) || defined(__NetBSD__)
 #include <syslog.h>
 int allow_severity = LOG_INFO;
 int deny_severity = LOG_WARNING;
@@ -370,12 +370,14 @@ ai_flags_str (struct addrinfo *ai)
 		if (ai->ai_flags & AI_NUMERICSERV) {
 			g_string_append (str, "numserv ");
 		}
+#if 0
 		if (ai->ai_flags & AI_V4MAPPED) {
 			g_string_append (str, "v4mapped ");
 		}
 		if (ai->ai_flags & AI_ALL) {
 			g_string_append (str, "all ");
 		}
+#endif
 	}
 	return g_string_free (str, FALSE);
 }
@@ -405,6 +407,14 @@ create_socket (struct addrinfo *ai)
 		return sock;
 	}
 
+#if defined(__NetBSD__) && ENABLE_IPV6
+	/* NetBSD defaults to V6ONLY */
+	{
+	int no = 0;
+	setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, &no, sizeof(no));
+	}
+#endif
+
 	if (bind (sock, ai->ai_addr, ai->ai_addrlen) < 0) {
 		gdm_error ("bind: %s", g_strerror (errno));
 		close (sock);
@@ -1259,7 +1269,9 @@ create_sa_from_request (ARRAY8 *req_addr
 
 	memset (&hints, 0, sizeof (hints));
 	hints.ai_family = family;
+#if !defined(__NetBSD__) || defined(AI_V4MAPPED)
 	hints.ai_flags = AI_V4MAPPED; /* this should convert IPv4 address to IPv6 if needed */
+#endif
 	if ((gaierr = getaddrinfo (host, serv, &hints, &ai_list)) != 0) {
 		gdm_debug ("Unable get address: %s", gai_strerror (gaierr));
 		return FALSE;
@@ -1278,6 +1290,20 @@ create_sa_from_request (ARRAY8 *req_addr
 
 	freeaddrinfo (ai_list);
 
+#if defined(__NetBSD__) && !defined(AI_V4MAPPED)
+	if (!found && family == AF_INET6 && req_addr->length == 4 && sap) {
+		struct sockaddr_in6 *sa = g_malloc(sizeof(struct sockaddr_in6));
+		memset(sa, 0, sizeof(struct sockaddr_in6));
+		sa->sin6_len = sizeof(struct sockaddr_in6);
+		sa->sin6_family = AF_INET6;
+		sa->sin6_port = port;
+		memset(&sa->sin6_addr.s6_addr[10], 0xff, 2);
+		memcpy(&sa->sin6_addr.s6_addr[12], req_addr->data, 4);
+		*sap = sa;
+		found = TRUE;
+	}
+#endif
+
 	return found;
 }