From d2a74926266311243f11f0cf0952d8f9111c26d0 Mon Sep 17 00:00:00 2001 From: Daniel Borkmann Date: Fri, 24 Nov 2023 18:00:02 +0000 Subject: [PATCH] fq: Fix to set missing TCA_FQ_PLIMIT attribute The qdiscPayload() function was missing the TCA_FQ_PLIMIT attribute for the Fq Qdisc. Therefore, it could not be changed via the library. Fix this up, so that QdiscReplace() with different qdisc.PacketLimit works now. Signed-off-by: Daniel Borkmann --- qdisc_linux.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qdisc_linux.go b/qdisc_linux.go index e182e1cf..431aa517 100644 --- a/qdisc_linux.go +++ b/qdisc_linux.go @@ -265,6 +265,9 @@ func qdiscPayload(req *nl.NetlinkRequest, qdisc Qdisc) error { if qdisc.Buckets > 0 { options.AddRtAttr(nl.TCA_FQ_BUCKETS_LOG, nl.Uint32Attr((uint32(qdisc.Buckets)))) } + if qdisc.PacketLimit > 0 { + options.AddRtAttr(nl.TCA_FQ_PLIMIT, nl.Uint32Attr((uint32(qdisc.PacketLimit)))) + } if qdisc.LowRateThreshold > 0 { options.AddRtAttr(nl.TCA_FQ_LOW_RATE_THRESHOLD, nl.Uint32Attr((uint32(qdisc.LowRateThreshold)))) }