* [PATCH net] rtnetlink: fix rtnl message size computation for XDP
@ 2016-11-15 10:16 Sabrina Dubroca
2016-11-15 19:05 ` Brenden Blanco
2016-11-16 3:43 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Sabrina Dubroca @ 2016-11-15 10:16 UTC (permalink / raw)
To: netdev; +Cc: Brenden Blanco, Sabrina Dubroca
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>
---
net/core/rtnetlink.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 5aeb61aadd32..5b4c3ba507d0 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -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;
--
2.10.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] rtnetlink: fix rtnl message size computation for XDP
2016-11-15 10:16 [PATCH net] rtnetlink: fix rtnl message size computation for XDP Sabrina Dubroca
@ 2016-11-15 19:05 ` Brenden Blanco
2016-11-16 3:43 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Brenden Blanco @ 2016-11-15 19:05 UTC (permalink / raw)
To: Sabrina Dubroca; +Cc: netdev
On Tue, Nov 15, 2016 at 11:16:35AM +0100, Sabrina Dubroca wrote:
> 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>
> ---
> net/core/rtnetlink.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
> index 5aeb61aadd32..5b4c3ba507d0 100644
> --- a/net/core/rtnetlink.c
> +++ b/net/core/rtnetlink.c
> @@ -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;
> --
> 2.10.2
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] rtnetlink: fix rtnl message size computation for XDP
2016-11-15 10:16 [PATCH net] rtnetlink: fix rtnl message size computation for XDP Sabrina Dubroca
2016-11-15 19:05 ` Brenden Blanco
@ 2016-11-16 3:43 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2016-11-16 3:43 UTC (permalink / raw)
To: sd; +Cc: netdev, bblanco
From: Sabrina Dubroca <sd@queasysnail.net>
Date: Tue, 15 Nov 2016 11:16:35 +0100
> 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>
Applied and queued up for -stable.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-11-16 3:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-15 10:16 [PATCH net] rtnetlink: fix rtnl message size computation for XDP Sabrina Dubroca
2016-11-15 19:05 ` Brenden Blanco
2016-11-16 3:43 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.