From aa8a274973d157f58e904b36adccc7ce06df5444 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Tue, 19 Mar 2024 10:14:00 +0100 Subject: [PATCH] dnsdist: Fix first IPv6 console connection being rejected Manually backported from 1a9b7f5a97e97e371bd4b6043c14d9faccb9013c. --- pdns/dnsdist-console.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pdns/dnsdist-console.cc b/pdns/dnsdist-console.cc index f40abb3446..3e92b566e9 100644 --- a/pdns/dnsdist-console.cc +++ b/pdns/dnsdist-console.cc @@ -1033,6 +1033,11 @@ void controlThread(std::shared_ptr acceptFD, ComboAddress local) { setThreadName("dnsdist/control"); ComboAddress client; + // make sure that the family matches the one from the listening IP, + // so that getSocklen() returns the correct size later, otherwise + // the first IPv6 console connection might get refused + client.sin4.sin_family = local.sin4.sin_family; + int sock{-1}; auto localACL = g_consoleACL.getLocal(); infolog("Accepting control connections on %s", local.toStringWithPort()); -- 2.47.3