From: Remi Gacogne Date: Tue, 7 Oct 2025 11:34:49 +0000 (+0200) Subject: dnsdist: Fix handling of large XSK frames X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F16242%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Fix handling of large XSK frames There was a bug in the way we were computing the remaining capacity of a XSK frame, because we forgot to account for the network headers. This caused some XSK responses to be discarded by the kernel (`tx_invalid_descs`) because there was not enough space left in the frame (less than `XDP_PACKET_HEADROOM`). Thanks to `ednaq` for reporting this via ou YesWeHack program. Signed-off-by: Remi Gacogne --- diff --git a/pdns/dnsdistdist/xsk.cc b/pdns/dnsdistdist/xsk.cc index d246a1d72e..5e6eb4c7aa 100644 --- a/pdns/dnsdistdist/xsk.cc +++ b/pdns/dnsdistdist/xsk.cc @@ -709,7 +709,7 @@ uint32_t XskPacket::getFrameLen() const noexcept size_t XskPacket::getCapacity() const noexcept { - return frameSize; + return frameSize - getDataOffset(); } void XskPacket::changeDirectAndUpdateChecksum() noexcept