fix expr.Cmp unmarshaling

This commit is contained in:
Michael Stapelberg 2018-06-28 20:05:16 +02:00
parent 48a6685597
commit 2338808f3c
1 changed files with 7 additions and 1 deletions

View File

@ -181,7 +181,13 @@ func (e *Cmp) unmarshal(data []byte) error {
case unix.NFTA_CMP_OP:
e.Op = CmpOp(binaryutil.BigEndian.Uint32(attr.Data))
case unix.NFTA_CMP_DATA:
e.Data = attr.Data
attrs, err := netlink.UnmarshalAttributes(attr.Data)
if err != nil {
return err
}
if len(attrs) == 1 && attrs[0].Type == unix.NFTA_DATA_VALUE {
e.Data = attrs[0].Data
}
}
}