Set userdata fix

Adds user data order bytes to set message
This commit is contained in:
turekt 2022-08-30 18:19:19 +00:00
parent e4bff45b7f
commit 2ae540cc25
1 changed files with 4 additions and 0 deletions

4
set.go
View File

@ -543,6 +543,10 @@ func (cc *Conn) AddSet(s *Set, vals []SetElement) error {
tableInfo = append(tableInfo,
// Semantically useless - kept for binary compatability with nft
netlink.Attribute{Type: unix.NFTA_SET_USERDATA, Data: []byte("\x00\x04\x02\x00\x00\x00")})
} else if !s.IsMap {
// Per https://git.netfilter.org/nftables/tree/src/mnl.c?id=187c6d01d35722618c2711bbc49262c286472c8f#n1165
tableInfo = append(tableInfo,
netlink.Attribute{Type: unix.NFTA_SET_USERDATA, Data: []byte("\x00\x04\x01\x00\x00\x00")})
}
cc.messages = append(cc.messages, netlink.Message{