nftables: fix staticcheck error for Conn.getObj (#137)
Signed-off-by: Matt Layher <mdlayher@gmail.com>
This commit is contained in:
parent
611d399a5e
commit
6f19c4381e
6
obj.go
6
obj.go
|
@ -185,15 +185,15 @@ func (cc *Conn) getObj(o Obj, t *Table, msgType uint16) ([]Obj, error) {
|
||||||
|
|
||||||
if o != nil {
|
if o != nil {
|
||||||
data, err = o.marshal(false)
|
data, err = o.marshal(false)
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
flags = netlink.Dump
|
flags = netlink.Dump
|
||||||
data, err = netlink.MarshalAttributes([]netlink.Attribute{
|
data, err = netlink.MarshalAttributes([]netlink.Attribute{
|
||||||
{Type: unix.NFTA_RULE_TABLE, Data: []byte(t.Name + "\x00")},
|
{Type: unix.NFTA_RULE_TABLE, Data: []byte(t.Name + "\x00")},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
message := netlink.Message{
|
message := netlink.Message{
|
||||||
Header: netlink.Header{
|
Header: netlink.Header{
|
||||||
|
|
Loading…
Reference in New Issue