summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Jacoutot <ajacoutot@gnome.org>2014-03-03 09:16:52 +0100
committerAntoine Jacoutot <ajacoutot@gnome.org>2014-03-03 17:03:56 +0100
commit262e075827c4b9a7fad866bde43953b5760360b1 (patch)
tree12d1c5105ad2261d1ee2c8121eb01105350cade2
parent446d061a8c27537062c46bad371dd739d7892d17 (diff)
downloadgdm-262e075827c4b9a7fad866bde43953b5760360b1.tar.gz
xdmcp: unbreak build on OpenBSD
OpenBSD has no support for IPv4 to IPv6 mapping, so make check for the required definitions before using them. https://bugzilla.gnome.org/show_bug.cgi?id=725554
-rw-r--r--daemon/gdm-xdmcp-display-factory.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/daemon/gdm-xdmcp-display-factory.c b/daemon/gdm-xdmcp-display-factory.c
index 69d18dca..28b03007 100644
--- a/daemon/gdm-xdmcp-display-factory.c
+++ b/daemon/gdm-xdmcp-display-factory.c
@@ -377,12 +377,16 @@ ai_flags_str (struct addrinfo *ai)
if (ai->ai_flags & AI_NUMERICSERV) {
g_string_append (str, "numserv ");
}
+#ifdef AI_V4MAPPEP
if (ai->ai_flags & AI_V4MAPPED) {
g_string_append (str, "v4mapped ");
}
+#endif
+#ifdef AI_ALL
if (ai->ai_flags & AI_ALL) {
g_string_append (str, "all ");
}
+#endif
}
return g_string_free (str, FALSE);
}
@@ -1528,7 +1532,9 @@ create_address_from_request (ARRAY8 *req_addr,
memset (&hints, 0, sizeof (hints));
hints.ai_family = family;
/* this should convert IPv4 address to IPv6 if needed */
+#ifdef AI_V4MAPPED
hints.ai_flags = AI_V4MAPPED;
+#endif
hints.ai_socktype = SOCK_DGRAM;
if ((gaierr = getaddrinfo (host, serv, &hints, &ai_list)) != 0) {
@@ -2011,7 +2017,9 @@ on_hostname_selected (GdmXdmcpChooserDisplay *display,
memset (&hints, 0, sizeof (hints));
hints.ai_family = gdm_address_get_family_type (address);
/* this should convert IPv4 address to IPv6 if needed */
+#ifdef AI_V4MAPPED
hints.ai_flags = AI_V4MAPPED;
+#endif
xdmcp_port = g_strdup_printf ("%d", XDM_UDP_PORT);
if ((gaierr = getaddrinfo (hostname, xdmcp_port, &hints, &ai_list)) != 0) {