set: desc size carries len(vals), not KeyType.Bytes

fixes #26
This commit is contained in:
Michael Stapelberg 2019-07-20 18:34:05 +02:00
parent 0b03b9847f
commit 37c3f0e9eb
1 changed files with 1 additions and 1 deletions

2
set.go
View File

@ -151,7 +151,7 @@ func (cc *Conn) AddSet(s *Set, vals []SetElement) error {
}
setData := cc.marshalAttr([]netlink.Attribute{
{Type: unix.NFTA_SET_DESC_SIZE, Data: binaryutil.BigEndian.PutUint32(uint32(s.KeyType.Bytes))},
{Type: unix.NFTA_SET_DESC_SIZE, Data: binaryutil.BigEndian.PutUint32(uint32(len(vals)))},
})
var flags uint32