From 5238ce7df6795addf1eced2e38d41f2a51d4ed8b Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sun, 19 May 2013 21:04:57 +0000 Subject: [PATCH] - Enable V6ONLY on ident sockets for ipv6 connections, patch from FalconKirtaran. (#4193) --- src/s_auth.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/s_auth.c b/src/s_auth.c index c417df281..206933d91 100644 --- a/src/s_auth.c +++ b/src/s_auth.c @@ -95,7 +95,7 @@ void start_auth(aClient *cptr) ident_failed(cptr); return; } - if (++OpenFiles >= (MAXCONNECTIONS - 2)) + if (++OpenFiles >= (MAXCONNECTIONS - 2)) { sendto_ops("Can't allocate fd, too many connections."); fd_close(cptr->authfd); @@ -104,6 +104,11 @@ void start_auth(aClient *cptr) return; } +#if defined(INET6) && defined(IPV6_V6ONLY) + int opt = 0; + setsockopt(cptr->authfd, IPPROTO_IPV6, IPV6_V6ONLY, (OPT_TYPE *)&opt, sizeof(opt)); +#endif + if (SHOWCONNECTINFO && !cptr->serv && !IsServersOnlyListener(cptr->listener)) sendto_one(cptr, "%s", REPORT_DO_ID);