Skip to content

Commit

Permalink
Set userdata fix (#180)
Browse files Browse the repository at this point in the history
Adds user data order bytes to set message
  • Loading branch information
turekt authored Aug 30, 2022
1 parent e4bff45 commit 64ce059
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions set.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 64ce059

Please sign in to comment.