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.
This commit is contained in:
世界 2026-03-15 14:15:22 +08:00
parent 0329538ecd
commit 82d14b26de
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -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{