From: Remi Gacogne Date: Mon, 17 Nov 2025 11:17:30 +0000 (+0100) Subject: dnsdist: Better handling of XSK frames without any data X-Git-Tag: rec-5.4.0-alpha1~22^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cbb214c47a3fcf10508a7b0439244fbcf11b8c74;p=thirdparty%2Fpdns.git dnsdist: Better handling of XSK frames without any data This might happen when we are creating a frame from scratch. Signed-off-by: Remi Gacogne --- diff --git a/pdns/dnsdistdist/xsk.cc b/pdns/dnsdistdist/xsk.cc index 4411196594..6689335a28 100644 --- a/pdns/dnsdistdist/xsk.cc +++ b/pdns/dnsdistdist/xsk.cc @@ -551,6 +551,10 @@ XskSocket::XskUmem::~XskUmem() [[nodiscard]] size_t XskPacket::getDataSize() const noexcept { + const auto dataOffset = getDataOffset(); + if (frameLength < dataOffset) { + return 0U; + } return frameLength - getDataOffset(); }