Compare commits
4 Commits
51156d19df
...
0a25fcafd0
Author | SHA1 | Date |
---|---|---|
|
0a25fcafd0 | |
|
0420ffbf57 | |
|
6f574e7fd1 | |
|
a0423c9897 |
|
@ -186,6 +186,9 @@ func (e *Ct) unmarshal(fam byte, data []byte) error {
|
||||||
e.Register = ad.Uint32()
|
e.Register = ad.Uint32()
|
||||||
case unix.NFTA_CT_DIRECTION:
|
case unix.NFTA_CT_DIRECTION:
|
||||||
e.Direction = ad.Uint32()
|
e.Direction = ad.Uint32()
|
||||||
|
case unix.NFTA_CT_SREG:
|
||||||
|
e.SourceRegister = true
|
||||||
|
e.Register = ad.Uint32()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ad.Err()
|
return ad.Err()
|
||||||
|
|
|
@ -38,6 +38,14 @@ func TestCt(t *testing.T) {
|
||||||
Direction: 1, // direction: reply
|
Direction: 1, // direction: reply
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "Unmarshal Ct source register case",
|
||||||
|
ct: Ct{
|
||||||
|
Register: 1,
|
||||||
|
Key: CtKeySRC,
|
||||||
|
SourceRegister: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
|
|
|
@ -209,6 +209,8 @@ func exprFromName(name string) Any {
|
||||||
e = &CtTimeout{}
|
e = &CtTimeout{}
|
||||||
case "fib":
|
case "fib":
|
||||||
e = &Fib{}
|
e = &Fib{}
|
||||||
|
case "numgen":
|
||||||
|
e = &Numgen{}
|
||||||
}
|
}
|
||||||
return e
|
return e
|
||||||
}
|
}
|
||||||
|
|
2
set.go
2
set.go
|
@ -784,7 +784,7 @@ func setsFromMsg(msg netlink.Message) (*Set, error) {
|
||||||
nftMagic := ad.Uint32()
|
nftMagic := ad.Uint32()
|
||||||
// Special case for the data type verdict, in the message it is stored as 0xffffff00 but it is defined as 1
|
// Special case for the data type verdict, in the message it is stored as 0xffffff00 but it is defined as 1
|
||||||
if nftMagic == 0xffffff00 {
|
if nftMagic == 0xffffff00 {
|
||||||
set.KeyType = TypeVerdict
|
set.DataType = TypeVerdict
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
dt, err := parseSetDatatype(nftMagic)
|
dt, err := parseSetDatatype(nftMagic)
|
||||||
|
|
Loading…
Reference in New Issue