From e14cdf5086b5c5a41a2f76625d71a609ca0ce38f Mon Sep 17 00:00:00 2001 From: black-desk Date: Fri, 20 Oct 2023 11:03:03 +0800 Subject: [PATCH] fix: void add unused set New kernel seems to refuse unused anonymous set. Signed-off-by: black-desk --- internal/nftman/method.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/nftman/method.go b/internal/nftman/method.go index b76c85c..ea20d3b 100644 --- a/internal/nftman/method.go +++ b/internal/nftman/method.go @@ -312,11 +312,6 @@ func (t *Table) addTproxyChainForTProxy( RegPort: 1, } - err = conn.AddSet(t.protoSet, t.protoSetElement) - if err != nil { - return - } - exprs := []expr.Any{ &expr.Meta{ // meta load l4proto => reg 1 Key: expr.MetaKeyL4PROTO, @@ -342,6 +337,11 @@ func (t *Table) addTproxyChainForTProxy( Register: 1, Data: []byte{unix.IPPROTO_TCP}, } + } else { + err = conn.AddSet(t.protoSet, t.protoSetElement) + if err != nil { + return + } } if tp.NoIPv6 {