Compare commits

..

No commits in common. "950e408d48c671ccd9f4997a4b6eb95db21365d6" and "2ba518ec5ca0f9be986cd2939af92cee6040eb8b" have entirely different histories.

3 changed files with 2 additions and 33 deletions

View File

@ -112,7 +112,6 @@ func (e *Payload) unmarshal(data []byte) error {
e.DestRegister = ad.Uint32()
case unix.NFTA_PAYLOAD_SREG:
e.SourceRegister = ad.Uint32()
e.OperationType = PayloadWrite
case unix.NFTA_PAYLOAD_BASE:
e.Base = PayloadBase(ad.Uint32())
case unix.NFTA_PAYLOAD_OFFSET:

View File

@ -77,35 +77,9 @@ func (e *Range) unmarshal(data []byte) error {
case unix.NFTA_RANGE_SREG:
e.Register = ad.Uint32()
case unix.NFTA_RANGE_FROM_DATA:
ad.Do(func(b []byte) error {
ad, err := netlink.NewAttributeDecoder(b)
if err != nil {
return err
}
ad.ByteOrder = binary.BigEndian
if ad.Next() && ad.Type() == unix.NFTA_DATA_VALUE {
ad.Do(func(b []byte) error {
e.FromData = b
return nil
})
}
return ad.Err()
})
e.FromData = ad.Bytes()
case unix.NFTA_RANGE_TO_DATA:
ad.Do(func(b []byte) error {
ad, err := netlink.NewAttributeDecoder(b)
if err != nil {
return err
}
ad.ByteOrder = binary.BigEndian
if ad.Next() && ad.Type() == unix.NFTA_DATA_VALUE {
ad.Do(func(b []byte) error {
e.ToData = b
return nil
})
}
return ad.Err()
})
e.ToData = ad.Bytes()
}
}
return ad.Err()

View File

@ -227,10 +227,6 @@ func exprsFromMsg(b []byte) ([]expr.Any, error) {
switch ad.Type() {
case unix.NFTA_EXPR_NAME:
name = ad.String()
if name == "notrack" {
e := &expr.Notrack{}
exprs = append(exprs, e)
}
case unix.NFTA_EXPR_DATA:
var e expr.Any
switch name {