From 37c3f0e9eb18b395d429c5fec07cff1fba4f8df7 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 20 Jul 2019 18:34:05 +0200 Subject: [PATCH] set: desc size carries len(vals), not KeyType.Bytes fixes #26 --- set.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/set.go b/set.go index bdc5abb..4bb00d6 100644 --- a/set.go +++ b/set.go @@ -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