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

Commit bad1c072 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ipv6: generate random IID only for temporary addresses on RAWIP devices"

parents 70a8626f bb6c3881
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -1904,10 +1904,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;
}