From 82d14b26ded586ff2aa8ce3312a0291b02f975d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Sun, 15 Mar 2026 14:15:22 +0800 Subject: [PATCH] Fix nftables single include_uid not working The single UID code path incorrectly used BigEndian to encode the UID for nft_cmp, but the kernel stores SKUIDs in native endian. --- redirect_nftables_rules.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redirect_nftables_rules.go b/redirect_nftables_rules.go index fe432f5..968a27d 100644 --- a/redirect_nftables_rules.go +++ b/redirect_nftables_rules.go @@ -424,7 +424,7 @@ func (r *autoRedirect) nftablesCreateExcludeRules(nft *nftables.Conn, table *nft &expr.Cmp{ Op: expr.CmpOpNeq, Register: 1, - Data: binaryutil.BigEndian.PutUint32(r.tunOptions.IncludeUID[0].Start), + Data: binaryutil.NativeEndian.PutUint32(r.tunOptions.IncludeUID[0].Start), }, &expr.Counter{}, &expr.Verdict{