From: Stefan Schmidt <stefan@osg.samsung.com>
To: Alexander Aring <aar@pengutronix.de>, linux-wpan@vger.kernel.org
Cc: kernel@pengutronix.de, marcel@holtmann.org,
jukka.rissanen@linux.intel.com, hannes@stressinduktion.org,
mcr@sandelman.ca, werner@almesberger.net,
linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org,
"David S . Miller" <davem@davemloft.net>,
Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
James Morris <jmorris@namei.org>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
Patrick McHardy <kaber@trash.net>
Subject: Re: [PATCHv3 net-next 06/12] ndisc: add __ndisc_fill_addr_option function
Date: Wed, 15 Jun 2016 17:13:10 +0200 [thread overview]
Message-ID: <57617086.8090208@osg.samsung.com> (raw)
In-Reply-To: <20160614115239.17788-7-aar@pengutronix.de>
Hello.
On 14/06/16 13:52, Alexander Aring wrote:
> This patch adds __ndisc_fill_addr_option as low-level function for
> ndisc_fill_addr_option which doesn't depend on net_device parameter.
>
> Cc: David S. Miller<davem@davemloft.net>
> Cc: Alexey Kuznetsov<kuznet@ms2.inr.ac.ru>
> Cc: James Morris<jmorris@namei.org>
> Cc: Hideaki YOSHIFUJI<yoshfuji@linux-ipv6.org>
> Cc: Patrick McHardy<kaber@trash.net>
> Signed-off-by: Alexander Aring<aar@pengutronix.de>
> ---
> net/ipv6/ndisc.c | 14 ++++++++++----
> 1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
> index c245895..a7b9468 100644
> --- a/net/ipv6/ndisc.c
> +++ b/net/ipv6/ndisc.c
> @@ -150,11 +150,10 @@ struct neigh_table nd_tbl = {
> };
> EXPORT_SYMBOL_GPL(nd_tbl);
>
> -static void ndisc_fill_addr_option(struct sk_buff *skb, int type, void *data)
> +static void __ndisc_fill_addr_option(struct sk_buff *skb, int type, void *data,
> + int data_len, int pad)
> {
> - int pad = ndisc_addr_option_pad(skb->dev->type);
> - int data_len = skb->dev->addr_len;
> - int space = ndisc_opt_addr_space(skb->dev);
> + int space = __ndisc_opt_addr_space(data_len, pad);
> u8 *opt = skb_put(skb, space);
>
> opt[0] = type;
> @@ -172,6 +171,13 @@ static void ndisc_fill_addr_option(struct sk_buff *skb, int type, void *data)
> memset(opt, 0, space);
> }
>
> +static inline void ndisc_fill_addr_option(struct sk_buff *skb, int type,
> + void *data)
> +{
> + __ndisc_fill_addr_option(skb, type, data, skb->dev->addr_len,
> + ndisc_addr_option_pad(skb->dev->type));
> +}
> +
> static struct nd_opt_hdr *ndisc_next_option(struct nd_opt_hdr *cur,
> struct nd_opt_hdr *end)
> {
Reviewed-by: Stefan Schmidt<stefan@osg.samsung.com>
regards
Stefan Schmidt
next prev parent reply other threads:[~2016-06-15 15:13 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-14 11:52 [PATCHv3 net-next 00/12] 6lowpan: introduce 6lowpan-nd Alexander Aring
2016-06-14 11:52 ` [PATCHv3 net-next 02/12] 6lowpan: add 802.15.4 short addr slaac Alexander Aring
2016-06-14 11:52 ` [PATCHv3 net-next 04/12] ndisc: add __ndisc_opt_addr_space function Alexander Aring
2016-06-15 11:07 ` YOSHIFUJI Hideaki
[not found] ` <20160614115239.17788-5-aar-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2016-06-15 15:09 ` Stefan Schmidt
2016-06-14 11:52 ` [PATCHv3 net-next 06/12] ndisc: add __ndisc_fill_addr_option function Alexander Aring
2016-06-15 11:08 ` YOSHIFUJI Hideaki
2016-06-15 15:13 ` Stefan Schmidt [this message]
2016-06-14 11:52 ` [PATCHv3 net-next 07/12] addrconf: put prefix address add in an own function Alexander Aring
[not found] ` <20160614115239.17788-8-aar-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2016-06-15 11:09 ` YOSHIFUJI Hideaki
2016-06-14 11:52 ` [PATCHv3 net-next 08/12] ipv6: introduce neighbour discovery ops Alexander Aring
[not found] ` <20160614115239.17788-9-aar-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2016-06-15 11:10 ` YOSHIFUJI Hideaki/吉藤英明
2016-06-14 11:52 ` [PATCHv3 net-next 09/12] ipv6: export several functions Alexander Aring
2016-06-15 11:11 ` YOSHIFUJI Hideaki
2016-06-15 15:18 ` Stefan Schmidt
[not found] ` <20160614115239.17788-1-aar-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2016-06-14 11:52 ` [PATCHv3 net-next 01/12] 6lowpan: add private neighbour data Alexander Aring
[not found] ` <20160614115239.17788-2-aar-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2016-06-15 11:05 ` YOSHIFUJI Hideaki
2016-06-14 11:52 ` [PATCHv3 net-next 03/12] 6lowpan: remove ipv6 module request Alexander Aring
2016-06-14 11:52 ` [PATCHv3 net-next 05/12] ndisc: add __ndisc_opt_addr_data function Alexander Aring
[not found] ` <20160614115239.17788-6-aar-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2016-06-15 11:07 ` YOSHIFUJI Hideaki
2016-06-15 15:11 ` Stefan Schmidt
2016-06-14 11:52 ` [PATCHv3 net-next 10/12] 6lowpan: introduce 6lowpan-nd Alexander Aring
2016-06-15 11:12 ` YOSHIFUJI Hideaki
2016-06-14 11:52 ` [PATCHv3 net-next 11/12] 6lowpan: add support for getting short address Alexander Aring
2016-06-15 11:03 ` [PATCHv3 net-next 00/12] 6lowpan: introduce 6lowpan-nd YOSHIFUJI Hideaki
2016-06-14 11:52 ` [PATCHv3 net-next 12/12] 6lowpan: add support for 802.15.4 short addr handling Alexander Aring
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=57617086.8090208@osg.samsung.com \
--to=stefan@osg.samsung.com \
--cc=aar@pengutronix.de \
--cc=davem@davemloft.net \
--cc=hannes@stressinduktion.org \
--cc=jmorris@namei.org \
--cc=jukka.rissanen@linux.intel.com \
--cc=kaber@trash.net \
--cc=kernel@pengutronix.de \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-wpan@vger.kernel.org \
--cc=marcel@holtmann.org \
--cc=mcr@sandelman.ca \
--cc=netdev@vger.kernel.org \
--cc=werner@almesberger.net \
--cc=yoshfuji@linux-ipv6.org \
/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).