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

Commit 0af2ccf0 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

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

parents 5d3a26a5 ef4cff49
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;
}