From fa660a9145bc5089023af015a140f86d040cff04 Mon Sep 17 00:00:00 2001 From: Chen Linxuan Date: Sat, 14 Nov 2026 23:46:39 +0800 Subject: [PATCH] Fix 32-bit build failure in transaction ID panic Reproduce with: GOARCH=386 go build ./... The compiler reports: ./conn.go:538:93: cannot use math.MaxUint32 (untyped int constant 4294967295) as int value in argument to fmt.Sprintf Convert the value to uint32 before formatting it with %d. --- conn.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conn.go b/conn.go index c986c13..9c5cfe8 100644 --- a/conn.go +++ b/conn.go @@ -535,7 +535,7 @@ func batch(messages []netlinkMessage, genID uint32) ([]netlink.Message, error) { // current transaction. func (cc *Conn) allocateTransactionID() uint32 { if cc.allocatedIDs == math.MaxUint32 { - panic(fmt.Sprintf("trying to allocate more than %d IDs in a single nftables transaction", math.MaxUint32)) + panic(fmt.Sprintf("trying to allocate more than %d IDs in a single nftables transaction", uint32(math.MaxUint32))) } // To make it more likely to catch when a transaction ID is erroneously used // in a later transaction, cc.lastID is not reset after each transaction;