Fix building

This commit is contained in:
Sander Hoentjen 2020-08-05 11:54:35 +02:00
parent d53f2bb389
commit 30fb8a063c
No known key found for this signature in database
GPG Key ID: 2D0D0318D5191146
3 changed files with 5 additions and 60 deletions

View File

@ -7,14 +7,12 @@
Name: dnsdist
Version: 1.5.0
Release: 3%{?dist}
Release: 4%{?dist}
Summary: Highly DNS-, DoS- and abuse-aware loadbalancer
License: GPLv2
URL: https://dnsdist.org
Source0: https://downloads.powerdns.com/releases/%{name}-%{version}.tar.bz2
Patch0: fix-build-with-gcc10.patch
ExcludeArch: armv7hl
BuildRequires: boost-devel
BuildRequires: fstrm-devel
BuildRequires: gcc-c++
@ -25,8 +23,7 @@ BuildRequires: libcap-devel
BuildRequires: libedit-devel
BuildRequires: libsodium-devel
BuildRequires: lmdb-devel
BuildRequires: lua-devel
%ifarch %{arm} %{ix86} x86_64 %{mips} aarch64
%ifarch %{ix86} x86_64 %{mips} aarch64
BuildRequires: luajit-devel
%else
BuildRequires: lua-devel
@ -65,13 +62,6 @@ sed -i '/^ExecStart/ s/dnsdist/dnsdist -u dnsdist -g dnsdist/' dnsdist.service.i
--disable-silent-rules \
--enable-dnscrypt \
--enable-dns-over-tls \
--enable-libsodium \
--enable-libssl \
%ifarch %{arm} %{ix86} x86_64 %{mips} aarch64
--with-luajit \
%else
--with-lua \
%endif
--enable-unit-tests \
--with-re2
@ -120,6 +110,9 @@ exit 0
%changelog
* Wed Aug 05 2020 Sander Hoentjen <sander@hoentjen.eu> - 1.5.0-4
- Fix building
* Wed Aug 05 2020 Sander Hoentjen <sander@hoentjen.eu> - 1.5.0-3
- Don't build on armv7hl, dnsdist fails to compile there

View File

@ -1,12 +0,0 @@
diff -up dnsdist-1.4.0/ext/yahttp/yahttp/reqresp.cpp.orig dnsdist-1.4.0/ext/yahttp/yahttp/reqresp.cpp
--- dnsdist-1.4.0/ext/yahttp/yahttp/reqresp.cpp.orig 2020-02-24 11:00:09.002212621 +0100
+++ dnsdist-1.4.0/ext/yahttp/yahttp/reqresp.cpp 2020-02-24 11:13:04.583572369 +0100
@@ -2,6 +2,8 @@
namespace YaHTTP {
+ template class AsyncLoader<Request>;
+
bool isspace(char c) {
return std::isspace(c) != 0;
}

View File

@ -1,36 +0,0 @@
From 60a518c8c246f43c53694160ebb7ca8b8b5c6346 Mon Sep 17 00:00:00 2001
From: Remi Gacogne <remi.gacogne@powerdns.com>
Date: Wed, 6 Jun 2018 00:10:13 +0200
Subject: [PATCH] dnsdist: Don't access the TCP buffer vector past its size
The required memory has been reserve()'d, but we are not allowed to
access it directly, and it breaks when compiled with the following
flag, checking any access to containers as if .at() were used:
-D_GLIBCXX_ASSERTIONS
---
pdns/dnsdist-tcp.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pdns/dnsdist-tcp.cc b/pdns/dnsdist-tcp.cc
index 0eb7ea1396..ab2bda916c 100644
--- a/pdns/dnsdist-tcp.cc
+++ b/pdns/dnsdist-tcp.cc
@@ -315,7 +315,7 @@ void* tcpClientThread(int pipefd)
bool ecsAdded = false;
/* allocate a bit more memory to be able to spoof the content,
or to add ECS without allocating a new buffer */
- queryBuffer.reserve(qlen + 512);
+ queryBuffer.resize(qlen + 512);
char* query = &queryBuffer[0];
handler.read(query, qlen, g_tcpRecvTimeout, remainingTime);
@@ -358,7 +358,7 @@ void* tcpClientThread(int pipefd)
uint16_t qtype, qclass;
unsigned int consumed = 0;
DNSName qname(query, qlen, sizeof(dnsheader), false, &qtype, &qclass, &consumed);
- DNSQuestion dq(&qname, qtype, qclass, &dest, &ci.remote, dh, queryBuffer.capacity(), qlen, true, &queryRealTime);
+ DNSQuestion dq(&qname, qtype, qclass, &dest, &ci.remote, dh, queryBuffer.size(), qlen, true, &queryRealTime);
if (!processQuery(holders, dq, poolname, &delayMsec, now)) {
goto drop;