nftables: fix staticcheck error for Conn.getObj (#137)

Signed-off-by: Matt Layher <mdlayher@gmail.com>
This commit is contained in:
Matt Layher 2021-12-09 17:08:38 -05:00 committed by GitHub
parent 611d399a5e
commit 6f19c4381e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

6
obj.go
View File

@ -185,15 +185,15 @@ func (cc *Conn) getObj(o Obj, t *Table, msgType uint16) ([]Obj, error) {
if o != nil {
data, err = o.marshal(false)
if err != nil {
return nil, err
}
} else {
flags = netlink.Dump
data, err = netlink.MarshalAttributes([]netlink.Attribute{
{Type: unix.NFTA_RULE_TABLE, Data: []byte(t.Name + "\x00")},
})
}
if err != nil {
return nil, err
}
message := netlink.Message{
Header: netlink.Header{