ipv6: generate random IID only for temporary addresses on RAWIP devices
RAWIP devices require the device IID to be used for permanent addresses only, and random IIDs to be generated for temporary addresses. Legacy user-space applications rely on this behavior CRs-Fixed: 860791 Change-Id: I007bdf8bcfdce687ad31612fed9d9c769321edb9 Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
This commit is contained in:
parent
07f438368c
commit
07c71659e8
1 changed files with 9 additions and 2 deletions
|
@ -2055,10 +2055,17 @@ static int ipv6_generate_eui64(u8 *eui, struct net_device *dev)
|
|||
return addrconf_ifid_ieee1394(eui, dev);
|
||||
case ARPHRD_TUNNEL6:
|
||||
return addrconf_ifid_ip6tnl(eui, dev);
|
||||
case ARPHRD_RAWIP:
|
||||
case ARPHRD_RAWIP: {
|
||||
struct in6_addr lladdr;
|
||||
|
||||
if (ipv6_get_lladdr(dev, &lladdr, IFA_F_TENTATIVE))
|
||||
get_random_bytes(eui, 8);
|
||||
else
|
||||
memcpy(eui, lladdr.s6_addr + 8, 8);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue