CtStat to CtState

This commit is contained in:
lyonsdpy 2021-05-14 17:46:19 +08:00
parent 65dfe1ac13
commit 7323feafb3
2 changed files with 6 additions and 6 deletions

View File

@ -49,11 +49,11 @@ const (
CtKeyEVENTMASK CtKey = unix.NFT_CT_EVENTMASK CtKeyEVENTMASK CtKey = unix.NFT_CT_EVENTMASK
// https://sources.debian.org/src//nftables/0.9.8-3/src/ct.c/?hl=39#L39 // https://sources.debian.org/src//nftables/0.9.8-3/src/ct.c/?hl=39#L39
CtStatBitINVALID uint32 = 1 CtStateBitINVALID uint32 = 1
CtStatBitESTABLISHED uint32 = 2 CtStateBitESTABLISHED uint32 = 2
CtStatBitRELATED uint32 = 4 CtStateBitRELATED uint32 = 4
CtStatBitNEW uint32 = 8 CtStateBitNEW uint32 = 8
CtStatBitUNTRACKED uint32 = 64 CtStateBitUNTRACKED uint32 = 64
) )
// Ct defines type for NFT connection tracking // Ct defines type for NFT connection tracking

View File

@ -1083,7 +1083,7 @@ func TestCtStat(t *testing.T) {
SourceRegister: 1, SourceRegister: 1,
DestRegister: 1, DestRegister: 1,
Len: 4, Len: 4,
Mask: binaryutil.NativeEndian.PutUint32(expr.CtStatBitESTABLISHED | expr.CtStatBitRELATED), Mask: binaryutil.NativeEndian.PutUint32(expr.CtStateBitESTABLISHED | expr.CtStateBitRELATED),
Xor: binaryutil.NativeEndian.PutUint32(0), Xor: binaryutil.NativeEndian.PutUint32(0),
}, },
&expr.Cmp{Op: expr.CmpOpNeq, Register: 1, Data: []byte{0, 0, 0, 0}}, &expr.Cmp{Op: expr.CmpOpNeq, Register: 1, Data: []byte{0, 0, 0, 0}},