summary refs log tree commit diff
path: root/gnu/packages/patches/lightdm-vnc-ipv6.patch
diff options
context:
space:
mode:
authorLiliana Marie Prikler <liliana.prikler@gmail.com>2023-07-13 17:21:32 +0200
committerLiliana Marie Prikler <liliana.prikler@gmail.com>2023-07-13 17:21:32 +0200
commit15406013fe63f2ab238eec2d7a8adbc586806ac8 (patch)
tree8377d7c70a925f7c5ea4c04473c4eb547610b64b /gnu/packages/patches/lightdm-vnc-ipv6.patch
parenta3ac317ab4a90f66ac65055fa26dee58ed2367b8 (diff)
parentdd4c1992103a65b8fbdc80fe07a9fe9be822769a (diff)
downloadguix-15406013fe63f2ab238eec2d7a8adbc586806ac8.tar.gz
Merge branch 'master' into emacs-team emacs-team
Diffstat (limited to 'gnu/packages/patches/lightdm-vnc-ipv6.patch')
-rw-r--r--gnu/packages/patches/lightdm-vnc-ipv6.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/gnu/packages/patches/lightdm-vnc-ipv6.patch b/gnu/packages/patches/lightdm-vnc-ipv6.patch
new file mode 100644
index 0000000000..68e4363d3e
--- /dev/null
+++ b/gnu/packages/patches/lightdm-vnc-ipv6.patch
@@ -0,0 +1,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;
+