From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: Tom Herbert <tom@herbertland.com>,
davem@davemloft.net, netdev@vger.kernel.org
Cc: kernel-team@fb.com
Subject: Re: [PATCH net-next] ila: ipv6/ila: fix nlsize calculation for lwtunnel
Date: Fri, 29 Apr 2016 09:40:08 +0200 [thread overview]
Message-ID: <57230FD8.8030609@6wind.com> (raw)
In-Reply-To: <1461888749-4105343-1-git-send-email-tom@herbertland.com>
Le 29/04/2016 02:12, Tom Herbert a écrit :
> The handler 'ila_fill_encap_info' adds two attributes: ILA_ATTR_LOCATOR
> and ILA_ATTR_CSUM_MODE.
>
> Also, do nla_put_u8 instead of nla_put_u64 for ILA_ATTR_CSUM_MODE.
>
> Fixes: 65d7ab8de582 ("net: Identifier Locator Addressing module")
> Reported-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> Signed-off-by: Tom Herbert <tom@herbertland.com>
> ---
> net/ipv6/ila/ila_lwt.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/net/ipv6/ila/ila_lwt.c b/net/ipv6/ila/ila_lwt.c
> index 4985e1a..7788090 100644
> --- a/net/ipv6/ila/ila_lwt.c
> +++ b/net/ipv6/ila/ila_lwt.c
> @@ -133,7 +133,7 @@ static int ila_fill_encap_info(struct sk_buff *skb,
> if (nla_put_u64_64bit(skb, ILA_ATTR_LOCATOR, (__force u64)p->locator.v64,
> ILA_ATTR_PAD))
> goto nla_put_failure;
> - if (nla_put_u64(skb, ILA_ATTR_CSUM_MODE, (__force u8)p->csum_mode))
> + if (nla_put_u8(skb, ILA_ATTR_CSUM_MODE, (__force u8)p->csum_mode))
> goto nla_put_failure;
>
> return 0;
> @@ -144,8 +144,12 @@ nla_put_failure:
>
> static int ila_encap_nlsize(struct lwtunnel_state *lwtstate)
> {
> - /* No encapsulation overhead */
> - return 0;
> + return
> + /* ILA_ATTR_LOCATOR */
> + nla_total_size(sizeof(u64)) +
It should be nla_total_size_64bit() here.
Regards,
Nicolas
next prev parent reply other threads:[~2016-04-29 7:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-29 0:12 [PATCH net-next] ila: ipv6/ila: fix nlsize calculation for lwtunnel Tom Herbert
2016-04-29 7:40 ` Nicolas Dichtel [this message]
2016-05-01 23:39 ` David Miller
2016-05-10 9:56 ` [PATCH net-next v2] " Nicolas Dichtel
2016-05-10 15:51 ` Tom Herbert
2016-05-10 20:01 ` 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=57230FD8.8030609@6wind.com \
--to=nicolas.dichtel@6wind.com \
--cc=davem@davemloft.net \
--cc=kernel-team@fb.com \
--cc=netdev@vger.kernel.org \
--cc=tom@herbertland.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).