public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Brenden Blanco <bblanco@plumgrid•com>
To: Sabrina Dubroca <sd@queasysnail•net>
Cc: netdev@vger•kernel.org
Subject: Re: [PATCH net] rtnetlink: fix rtnl message size computation for XDP
Date: Tue, 15 Nov 2016 11:05:40 -0800	[thread overview]
Message-ID: <20161115190540.GA10191@gmail.com> (raw)
In-Reply-To: <0169d2419991a4ba533087a4fda70420ccdaca30.1479204870.git.sd@queasysnail.net>

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
> 

  reply	other threads:[~2016-11-15 19:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-15 10:16 [PATCH net] rtnetlink: fix rtnl message size computation for XDP Sabrina Dubroca
2016-11-15 19:05 ` Brenden Blanco [this message]
2016-11-16  3:43 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161115190540.GA10191@gmail.com \
    --to=bblanco@plumgrid$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=sd@queasysnail$(echo .)net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox