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);