mirror of https://github.com/vishvananda/netlink
Fix failing XDP test
On newer linux kernels (4.12), netlink rejects a request to set an XDP program with flags set to 0. Instead, flags need to not be specified if they are 0.
This commit is contained in:
parent
7d0c00f02e
commit
241d179eba
|
@ -1811,8 +1811,10 @@ func addXdpAttrs(xdp *LinkXdp, req *nl.NetlinkRequest) {
|
|||
b := make([]byte, 4)
|
||||
native.PutUint32(b, uint32(xdp.Fd))
|
||||
nl.NewRtAttrChild(attrs, nl.IFLA_XDP_FD, b)
|
||||
native.PutUint32(b, xdp.Flags)
|
||||
nl.NewRtAttrChild(attrs, nl.IFLA_XDP_FLAGS, b)
|
||||
if xdp.Flags != 0 {
|
||||
native.PutUint32(b, xdp.Flags)
|
||||
nl.NewRtAttrChild(attrs, nl.IFLA_XDP_FLAGS, b)
|
||||
}
|
||||
req.AddData(attrs)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue