Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ef4cff49 authored by Subash Abhinov Kasiviswanathan's avatar Subash Abhinov Kasiviswanathan
Browse files

net: ipv6: Generate all random IID for addresses on RAWIP devices



This reverts commit 557a3b4d ("net: ipv6: Generate random IID
for addresses on RAWIP devices") and commit 8601ea92 ("ipv6: Do
not generate random IID only for RAWIP devices").

This scheme allows for generation of a new IID each time the
interface state is toggled rather than it persisting for the
lifetime of the device.

CRs-Fixed: 2543337
Change-Id: I5c524ae18c374e3afcc26b4ba93a292d51839ed1
Signed-off-by: default avatarSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>
parent 30d171ac
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -2253,8 +2253,17 @@ static int ipv6_generate_eui64(u8 *eui, struct net_device *dev)
		return addrconf_ifid_ieee1394(eui, dev);
	case ARPHRD_TUNNEL6:
	case ARPHRD_IP6GRE:
	case ARPHRD_RAWIP:
		return addrconf_ifid_ip6tnl(eui, dev);
	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;
}