From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?5ZCJ6Jek6Iux5piO?= Subject: Re: [PATCH net-next] net: ipv6: Generate random IID for addresses on RAWIP devices Date: Mon, 4 Jun 2018 08:50:49 +0900 Message-ID: References: <1528062874-19250-1-git-send-email-subashab@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: davem@davemloft.net, netdev@vger.kernel.org, yoshfuji@linux-ipv6.org To: Subash Abhinov Kasiviswanathan Return-path: Received: from mail-it0-f68.google.com ([209.85.214.68]:34428 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751132AbeFCXvL (ORCPT ); Sun, 3 Jun 2018 19:51:11 -0400 Received: by mail-it0-f68.google.com with SMTP id y127-v6so8868605itd.1 for ; Sun, 03 Jun 2018 16:51:10 -0700 (PDT) In-Reply-To: <1528062874-19250-1-git-send-email-subashab@codeaurora.org> Sender: netdev-owner@vger.kernel.org List-ID: Hello, 2018-06-04 6:54 GMT+09:00 Subash Abhinov Kasiviswanathan : > 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 > --- > 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