Thread (5 messages) flat view 5 messages, 4 authors, 2018-06-09

Re: [PATCH net-next] net: ipv6: Generate random IID for addresses on RAWIP devices

From: 吉藤英明 <hidden>
Date: 2018-06-03 23:51:11

Hello,

2018-06-04 6:54 GMT+09:00 Subash Abhinov Kasiviswanathan
[off-list ref]:
quoted hunk ↗ jump to hunk
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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help