Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions builder-support/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ cython==3.2.4 \
--hash=sha256:fdfdd753ad7e18e5092b413e9f542e8d28b8a08203126090e1c15f7783b7fe57 \
--hash=sha256:ff9af2134c05e3734064808db95b4dd7341a39af06e8945d05ea358e1741aaed
# via -r requirements.in
idna==3.13 \
--hash=sha256:585ea8fe5d69b9181ec1afba340451fba6ba764af97026f92a91d4eef164a242 \
--hash=sha256:892ea0cde124a99ce773decba204c5552b69c3c67ffd5f232eb7696135bc8bb3
idna==3.15 \
--hash=sha256:048adeaf8c2d788c40fee287673ccaa74c24ffd8dcf09ffa555a2fbb59f10ac8 \
--hash=sha256:ca962446ea538f7092a95e057da437618e886f4d349216d2b1e294abfdb65fdc
# via requests
invoke==3.0.3 \
--hash=sha256:437b6a622223824380bfb4e64f612711a6b648c795f565efc8625af66fb57f0c \
Expand Down Expand Up @@ -307,9 +307,9 @@ toml==0.10.2 \
--hash=sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b \
--hash=sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f
# via pulp-cli
urllib3==2.6.3 \
--hash=sha256:1b62b6884944a57dbe321509ab94fd4d3b307075e0c2eae991ac71ee15ad38ed \
--hash=sha256:bf272323e553dfb2e87d9bfd225ca7b0f467b919d7bbd355436d3fd37cb0acd4
urllib3==2.7.0 \
--hash=sha256:231e0ec3b63ceb14667c67be60f2f2c40a518cb38b03af60abc813da26505f4c \
--hash=sha256:9fb4c81ebbb1ce9531cce37674bbc6f1360472bc18ca9a553ede278ef7276897
# via requests

# The following packages are considered to be unsafe in a requirements file:
Expand Down
278 changes: 139 additions & 139 deletions docs/requirements.txt

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions meson/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ cython==3.2.4 \
--hash=sha256:fdfdd753ad7e18e5092b413e9f542e8d28b8a08203126090e1c15f7783b7fe57 \
--hash=sha256:ff9af2134c05e3734064808db95b4dd7341a39af06e8945d05ea358e1741aaed
# via -r requirements.in
idna==3.13 \
--hash=sha256:585ea8fe5d69b9181ec1afba340451fba6ba764af97026f92a91d4eef164a242 \
--hash=sha256:892ea0cde124a99ce773decba204c5552b69c3c67ffd5f232eb7696135bc8bb3
idna==3.15 \
--hash=sha256:048adeaf8c2d788c40fee287673ccaa74c24ffd8dcf09ffa555a2fbb59f10ac8 \
--hash=sha256:ca962446ea538f7092a95e057da437618e886f4d349216d2b1e294abfdb65fdc
# via requests
invoke==3.0.3 \
--hash=sha256:437b6a622223824380bfb4e64f612711a6b648c795f565efc8625af66fb57f0c \
Expand Down Expand Up @@ -291,9 +291,9 @@ requests==2.33.0 \
--hash=sha256:3324635456fa185245e24865e810cecec7b4caf933d7eb133dcde67d48cee69b \
--hash=sha256:c7ebc5e8b0f21837386ad0e1c8fe8b829fa5f544d8df3b2253bff14ef29d7652
# via -r requirements.in
urllib3==2.6.3 \
--hash=sha256:1b62b6884944a57dbe321509ab94fd4d3b307075e0c2eae991ac71ee15ad38ed \
--hash=sha256:bf272323e553dfb2e87d9bfd225ca7b0f467b919d7bbd355436d3fd37cb0acd4
urllib3==2.7.0 \
--hash=sha256:231e0ec3b63ceb14667c67be60f2f2c40a518cb38b03af60abc813da26505f4c \
--hash=sha256:9fb4c81ebbb1ce9531cce37674bbc6f1360472bc18ca9a553ede278ef7276897
# via requests

# The following packages are considered to be unsafe in a requirements file:
Expand Down
6 changes: 3 additions & 3 deletions modules/remotebackend/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ cython==3.2.4 \
--hash=sha256:fdfdd753ad7e18e5092b413e9f542e8d28b8a08203126090e1c15f7783b7fe57 \
--hash=sha256:ff9af2134c05e3734064808db95b4dd7341a39af06e8945d05ea358e1741aaed
# via -r requirements.in
packaging==26.1 \
--hash=sha256:5d9c0669c6285e491e0ced2eee587eaf67b670d94a19e94e3984a481aba6802f \
--hash=sha256:f042152b681c4bfac5cae2742a55e103d27ab2ec0f3d88037136b6bfe7c9c5de
packaging==26.2 \
--hash=sha256:5fc45236b9446107ff2415ce77c807cee2862cb6fac22b8a73826d0693b0980e \
--hash=sha256:ff452ff5a3e828ce110190feff1178bb1f2ea2281fa2075aadb987c2fb221661
# via
# setuptools-scm
# vcs-versioning
Expand Down
2 changes: 1 addition & 1 deletion pdns/dnsdistdist/dnsdist-configuration-yaml.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@ bool loadConfigurationFromFile(const std::string& fileName, [[maybe_unused]] boo

#if defined(HAVE_XSK)
for (const auto& xskEntry : globalConfig.xsk) {
auto map = std::shared_ptr<XSKMap>();
auto map = std::make_shared<XSKMap>();
for (size_t counter = 0; counter < xskEntry.queues; ++counter) {
auto socket = std::make_shared<XskSocket>(xskEntry.frames, std::string(xskEntry.interface), counter, std::string(xskEntry.map_path));
dnsdist::xsk::g_xsk.push_back(socket);
Expand Down
16 changes: 11 additions & 5 deletions pdns/dnsdistdist/dnsdist-dnsparser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,28 @@ DNSPacketOverlay::DNSPacketOverlay(const std::string_view& packet)
}

memcpy(&d_header, packet.data(), sizeof(dnsheader));
uint64_t numRecords = ntohs(d_header.ancount) + ntohs(d_header.nscount) + ntohs(d_header.arcount);
d_records.reserve(numRecords);
uint64_t supposedRecordCount = ntohs(d_header.ancount) + ntohs(d_header.nscount) + ntohs(d_header.arcount);
// No need to reserve more memory for more records than the request can
// contain. We could try to be smarter and actually count the records
// by doing getDnsrecordheader and skip the payload in a loop, but all
// we really want here is to avoid reserving too much memory in case of
// maliciously high record counts.
auto reserveRecordCount = std::min(1 + ((packet.size() - sizeof(dnsheader)) / sizeof(dnsrecordheader)), static_cast<size_t>(supposedRecordCount));
d_records.reserve(reserveRecordCount);

try {
PacketReader reader(std::string_view(reinterpret_cast<const char*>(packet.data()), packet.size()));

for (uint16_t n = 0; n < ntohs(d_header.qdcount); ++n) {
for (uint16_t idx = 0; idx < ntohs(d_header.qdcount); ++idx) {
reader.xfrName(d_qname);
reader.xfrType(d_qtype);
reader.xfrType(d_qclass);
}

for (uint64_t n = 0; n < numRecords; ++n) {
for (uint64_t idx = 0; idx < supposedRecordCount; ++idx) {
Record rec;
reader.xfrName(rec.d_name);
rec.d_place = n < ntohs(d_header.ancount) ? DNSResourceRecord::ANSWER : (n < (ntohs(d_header.ancount) + ntohs(d_header.nscount)) ? DNSResourceRecord::AUTHORITY : DNSResourceRecord::ADDITIONAL);
rec.d_place = idx < ntohs(d_header.ancount) ? DNSResourceRecord::ANSWER : (idx < (ntohs(d_header.ancount) + ntohs(d_header.nscount)) ? DNSResourceRecord::AUTHORITY : DNSResourceRecord::ADDITIONAL);
reader.xfrType(rec.d_type);
reader.xfrType(rec.d_class);
reader.xfr32BitInt(rec.d_ttl);
Expand Down
4 changes: 2 additions & 2 deletions pdns/dnsdistdist/dnsdist-dynblocks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -758,10 +758,10 @@ void DynBlockMaintenance::generateMetrics()
auto& stat = reasonStat[entry.first];
if (entry.second < stat.lastSeenValue) {
/* it wrapped, or we did not have a last value */
stat.sum = entry.second;
stat.sum += entry.second;
}
else {
stat.sum = entry.second - stat.lastSeenValue;
stat.sum += entry.second - stat.lastSeenValue;
}
stat.lastSeenValue = entry.second;
}
Expand Down
11 changes: 10 additions & 1 deletion pdns/dnsdistdist/dnsdist-ecs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,11 @@ static bool addECSToExistingOPT(PacketBuffer& packet, size_t maximumSize, const
return false;
}

uint16_t newRDLen = oldRDLen + newECSOption.size();
const uint32_t computedRDLen = static_cast<uint32_t>(oldRDLen) + newECSOption.size();
if (computedRDLen > std::numeric_limits<uint16_t>::max()) {
return false;
}
const auto newRDLen = static_cast<uint16_t>(computedRDLen);
packet.at(optRDLenPosition) = newRDLen / 256;
packet.at(optRDLenPosition + 1) = newRDLen % 256;

Expand Down Expand Up @@ -612,6 +616,11 @@ bool handleEDNSClientSubnet(PacketBuffer& packet, const size_t maximumSize, cons
return replaceEDNSClientSubnetOption(packet, maximumSize, optRDPosition + ecsOptionStartPosition, ecsOptionSize, optRDPosition, newECSOption);
}

if (res != ENOENT) {
/* something is wrong */
return false;
}

/* we have an EDNS OPT RR but no existing ECS option */
return addECSToExistingOPT(packet, maximumSize, newECSOption, optRDPosition, ecsAdded);
}
Expand Down
2 changes: 1 addition & 1 deletion pdns/dnsdistdist/dnsdist-lua-bindings-dnsquestion.cc
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ void setupLuaBindingsDNSQuestion([[maybe_unused]] LuaContext& luaCtx)
return result;
}

result.resize(dnsQuestion.proxyProtocolValues->size());
result.reserve(dnsQuestion.proxyProtocolValues->size());
for (const auto& value : *dnsQuestion.proxyProtocolValues) {
result.emplace_back(value.type, value.content);
}
Expand Down
Loading
Loading