[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bindv6only again



On Mon, Apr 26, 2010 at 19:30:14 +0200, Josselin Mouette wrote:

> Le lundi 26 avril 2010 à 15:17 +0000, Clint Adams a écrit : 
> > On Mon, Apr 26, 2010 at 04:53:24PM +0200, Juliusz Chroboczek wrote:
> > > The apparent consensus is being ignored -- the default value is still
> > > the one that people don't want.
> > 
> > It's the one that I want.
> 
> Good. Now if you or one of those who advocate this “broken by default”
> behavior could provide patches for gdm3, this would be more productive.
> 
Not that I advocate the broken current default, but here's a
not-even-build-tested patch against master.

Cheers,
Julien

From: Julien Cristau <jcristau@debian.org>
Date: Mon, 26 Apr 2010 19:42:16 +0200
Subject: [PATCH] xdmcp: disable IPV6_V6ONLY for ipv6 listening sockets

This allows ipv4 connections mapped to ipv6, in case the system default
is backwards.

Signed-off-by: Julien Cristau <jcristau@debian.org>
---
 daemon/gdm-xdmcp-display-factory.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/daemon/gdm-xdmcp-display-factory.c b/daemon/gdm-xdmcp-display-factory.c
index 447833d..87a0d1a 100644
--- a/daemon/gdm-xdmcp-display-factory.c
+++ b/daemon/gdm-xdmcp-display-factory.c
@@ -411,6 +411,14 @@ create_socket (struct addrinfo *ai)
                 return sock;
         }
 
+#if defined(ENABLE_IPV6) && defined(IPV6_V6ONLY)
+	if (ai->ai_family == AF_INET6) {
+		int zero = 0;
+		if (setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, &zero, sizeof(zero)) < 0)
+			g_warning("setsockopt(IPV6_V6ONLY): %s", g_strerror(errno));
+	}
+#endif
+
         if (bind (sock, ai->ai_addr, ai->ai_addrlen) < 0) {
                 g_warning ("bind: %s", g_strerror (errno));
                 close (sock);
-- 
1.7.0.5

Attachment: signature.asc
Description: Digital signature


Reply to: