diff --git a/expr/lookup.go b/expr/lookup.go index 50dd5fc..67ab165 100644 --- a/expr/lookup.go +++ b/expr/lookup.go @@ -29,6 +29,7 @@ type Lookup struct { SetID uint32 SetName string + Invert bool } func (e *Lookup) marshal() ([]byte, error) { @@ -40,6 +41,9 @@ func (e *Lookup) marshal() ([]byte, error) { if e.DestRegister != 0 { opAttrs = append(opAttrs, netlink.Attribute{Type: unix.NFTA_LOOKUP_DREG, Data: binaryutil.BigEndian.PutUint32(e.DestRegister)}) } + if e.Invert { + opAttrs = append(opAttrs, netlink.Attribute{Type: unix.NFTA_LOOKUP_FLAGS, Data: binaryutil.BigEndian.PutUint32(unix.NFT_LOOKUP_F_INV)}) + } opAttrs = append(opAttrs, netlink.Attribute{Type: unix.NFTA_LOOKUP_SET, Data: []byte(e.SetName + "\x00")}, netlink.Attribute{Type: unix.NFTA_LOOKUP_SET_ID, Data: binaryutil.BigEndian.PutUint32(e.SetID)},