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; lue='range'>range
path: root/gnu/services/networking.scm
AgeCommit message (Expand)Author
2021-05-19services: opendht: Fix hang at boot....Maxim Cournoyer
2021-05-17services: Add a service for opendht....Maxim Cournoyer
2021-04-12services: ipfs: Tweak description....Ludovic Courtès
2021-04-12services: Add ipfs-service-type...Maxime Devos
2021-02-22services: tor: Add control-socket? option....Christopher Lemmer Webber
2021-01-16services: openntpd: Remove support for deprecated "-s" option....Simon South
2021-01-13services: shepherd: 'shepherd-service-type' requires documentation....Ludovic Courtès
2021-01-12services: Add keepalived service....Oleg Pykhalov
2020-11-05services: Add yggdrasil-service-type....raingloom
2020-09-24services: WPA Supplicant: Conditionally depend on D-Bus....Marius Bakke
2020-08-16services: connman-shepherd-service: Don't use short flags....Efraim Flashner