From 4b2264477a081b24ee3a49865c4d4aae36cdced7 Mon Sep 17 00:00:00 2001 From: Serguei Bezverkhi Date: Sat, 31 Aug 2019 03:36:20 -0400 Subject: [PATCH] lookup dest reg check fix (#57) Signed-off-by: Serguei Bezverkhi --- expr/lookup.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/expr/lookup.go b/expr/lookup.go index 6bdf986..b41b1fc 100644 --- a/expr/lookup.go +++ b/expr/lookup.go @@ -26,6 +26,7 @@ import ( type Lookup struct { SourceRegister uint32 DestRegister uint32 + IsDestRegSet bool SetID uint32 SetName string @@ -38,7 +39,7 @@ func (e *Lookup) marshal() ([]byte, error) { if e.SourceRegister != 0 { opAttrs = append(opAttrs, netlink.Attribute{Type: unix.NFTA_LOOKUP_SREG, Data: binaryutil.BigEndian.PutUint32(e.SourceRegister)}) } - if e.DestRegister != 0 { + if e.IsDestRegSet { opAttrs = append(opAttrs, netlink.Attribute{Type: unix.NFTA_LOOKUP_DREG, Data: binaryutil.BigEndian.PutUint32(e.DestRegister)}) } if e.Invert {