From: 吉藤英明 <hideaki.yoshifuji@miraclelinux.com>
To: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org, yoshfuji@linux-ipv6.org
Subject: Re: [PATCH net-next] net: ipv6: Generate random IID for addresses on RAWIP devices
Date: Mon, 4 Jun 2018 08:50:49 +0900 [thread overview]
Message-ID: <CAPA1RqBmffQObdTWMxNSNMRTgM9gPjD4KGqk2+MTwdbR34Wkhw@mail.gmail.com> (raw)
In-Reply-To: <1528062874-19250-1-git-send-email-subashab@codeaurora.org>
Hello,
2018-06-04 6:54 GMT+09:00 Subash Abhinov Kasiviswanathan
<subashab@codeaurora.org>:
> RAWIP devices such as rmnet do not have a hardware address and
> instead require the kernel to generate a random IID for the
> temporary addresses. For permanent addresses, the device IID is
> used along with prefix received.
>
> Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
> ---
> net/ipv6/addrconf.c | 17 ++++++++++++++++-
> 1 file changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> index f09afc2..e4c4540 100644
> --- a/net/ipv6/addrconf.c
> +++ b/net/ipv6/addrconf.c
> @@ -2230,6 +2230,18 @@ static int addrconf_ifid_ip6tnl(u8 *eui, struct net_device *dev)
> return 0;
> }
>
> +static int addrconf_ifid_rawip(u8 *eui, struct net_device *dev)
> +{
> + struct in6_addr lladdr;
> +
> + if (ipv6_get_lladdr(dev, &lladdr, IFA_F_TENTATIVE))
> + get_random_bytes(eui, 8);
Please be aware of I/G bit and G/L bit.
--yoshfuji
next prev parent reply other threads:[~2018-06-03 23:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-03 21:54 [PATCH net-next] net: ipv6: Generate random IID for addresses on RAWIP devices Subash Abhinov Kasiviswanathan
2018-06-03 23:50 ` 吉藤英明 [this message]
2018-06-08 2:52 ` Lorenzo Colitti
2018-06-09 0:34 ` Subash Abhinov Kasiviswanathan
2018-06-04 21:15 ` 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=CAPA1RqBmffQObdTWMxNSNMRTgM9gPjD4KGqk2+MTwdbR34Wkhw@mail.gmail.com \
--to=hideaki.yoshifuji@miraclelinux.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=subashab@codeaurora.org \
--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).