mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
rtnetlink: fix rtnl message size computation for XDP
rtnl_xdp_size() only considers the size of the actual payload attribute, and misses the space taken by the attribute used for nesting (IFLA_XDP). Fixes: d1fdd9138682 ("rtnl: add option for setting link xdp prog") Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Reviewed-by: Brenden Blanco <bblanco@plumgrid.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
7e75f74a17
commit
b3cfaa31e3
@ -901,7 +901,8 @@ static size_t rtnl_port_size(const struct net_device *dev,
|
||||
|
||||
static size_t rtnl_xdp_size(const struct net_device *dev)
|
||||
{
|
||||
size_t xdp_size = nla_total_size(1); /* XDP_ATTACHED */
|
||||
size_t xdp_size = nla_total_size(0) + /* nest IFLA_XDP */
|
||||
nla_total_size(1); /* XDP_ATTACHED */
|
||||
|
||||
if (!dev->netdev_ops->ndo_xdp)
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user