aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/lightdm-vnc-ipv6.patch
blob: 68e4363d3e381efcb7a8a9c8f8144b518e5e3249 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Submitted upstream: https://github.com/canonical/lightdm/pull/312

diff --git a/src/vnc-server.c b/src/vnc-server.c
index d3500764..00a2fc02 100644
--- a/src/vnc-server.c
+++ b/src/vnc-server.c
@@ -126,18 +126,10 @@ vnc_server_start (VNCServer *server)
 
     g_return_val_if_fail (server != NULL, FALSE);
 
-    g_autoptr(GError) ipv4_error = NULL;
-    priv->socket = open_tcp_socket (G_SOCKET_FAMILY_IPV4, priv->port, priv->listen_address, &ipv4_error);
-    if (ipv4_error)
-        g_warning ("Failed to create IPv4 VNC socket: %s", ipv4_error->message);
-
-    if (priv->socket)
-    {
-        GSource *source = g_socket_create_source (priv->socket, G_IO_IN, NULL);
-        g_source_set_callback (source, (GSourceFunc) read_cb, server, NULL);
-        g_source_attach (source, NULL);
-    }
-
+    // Bind to IPv6 first, as this implies binding to 0.0.0.0 in the
+    // Linux kernel default configuration, which would otherwise cause
+    // IPv6 clients to fail with "Error binding to address [::]:5900:
+    // Address already in use" (#266).
     g_autoptr(GError) ipv6_error = NULL;
     priv->socket6 = open_tcp_socket (G_SOCKET_FAMILY_IPV6, priv->port, priv->listen_address, &ipv6_error);
     if (ipv6_error)
@@ -150,6 +142,18 @@ vnc_server_start (VNCServer *server)
         g_source_attach (source, NULL);
     }
 
+    g_autoptr(GError) ipv4_error = NULL;
+    priv->socket = open_tcp_socket (G_SOCKET_FAMILY_IPV4, priv->port, priv->listen_address, &ipv4_error);
+    if (ipv4_error)
+        g_warning ("Failed to create IPv4 VNC socket: %s", ipv4_error->message);
+
+    if (priv->socket)
+    {
+        GSource *source = g_socket_create_source (priv->socket, G_IO_IN, NULL);
+        g_source_set_callback (source, (GSourceFunc) read_cb, server, NULL);
+        g_source_attach (source, NULL);
+    }
+
     if (!priv->socket && !priv->socket6)
         return FALSE;
 
t autoconf time....Ludovic Courtès 2015-02-26build: Bump version number....Ludovic Courtès 2015-02-24build: Reject or warn against file name length limit overruns....Ludovic Courtès 2015-01-23build: Change version to 0.8.1....Ludovic Courtès 2014-12-02emacs: Move profiles code to "guix-profiles.el.in"....Alex Kost 2014-11-25build: Bump version number....Ludovic Courtès 2014-09-29import: Add PyPI importer....David Thompson 2014-09-27build: Don't generate Emacs autoloads when Emacs is unavailable....Ludovic Courtès 2014-09-03Add Emacs user interface....Alex Kost 2014-07-25build: Bump to version 0.8....Ludovic Courtès 2014-07-22Require only lower gettext version....Andreas Enge 2014-06-13Separate package description translations from string translations....Ludovic Courtès 2014-06-13Move gettext files to 'po/guix'....Ludovic Courtès 2014-05-22build: Fix builds without --with-libgcrypt-prefix nor --with-libgcrypt-libdir....Ludovic Courtès 2014-05-17build: Add --with-libgcrypt-libdir=DIR to support Debian's multi-arch layout....Ludovic Courtès 2014-04-09build: Bump to version 0.7....Ludovic Courtès 2014-03-09Change the default store file name to /gnu/store....Ludovic Courtès 2014-01-24store: Add 'register-path' procedure....Ludovic Courtès 2013-12-29build: Improve documentation of Nix-related options....Ludovic Courtès 2013-12-29config: Export '%config-directory'....Ludovic Courtès 2013-12-11build: Bump to version 0.6....Ludovic Courtès 2013-11-23build: Make sure pkg.m4 is present....Ludovic Courtès 2013-09-27build: Bump version to 0.5....Ludovic Courtès 2013-08-29build: Use `missing' for `dot'....Ludovic Courtès 2013-08-29build: Build docs from the top-level Makefile....Ludovic Courtès 2013-07-19build: Bump version to 0.4....Ludovic Courtès 2013-07-17build: Provide a replacement (srfi srfi-37) when the user's one is broken....Ludovic Courtès 2013-07-05build: Bail out on unsupported platforms; add `--with-courage'....Ludovic Courtès 2013-05-18build: Switch to 0.3....Ludovic Courtès 2013-05-12build: Use separate `AC_CONFIG_FILES' invocations for executable files....Ludovic Courtès 2013-05-10build: Make sure the user's Guile has all the required features....Ludovic Courtès 2013-04-27build: Explicitly require Guile >= 2.0.5....Ludovic Courtès 2013-02-16Replace individual scripts with master 'guix' script....Mark H Weaver 2013-02-06build: `chmod +x' scripts as they are generated....Ludovic Courtès