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

Commit 8601ea92 authored by Subash Abhinov Kasiviswanathan's avatar Subash Abhinov Kasiviswanathan
Browse files

ipv6: Do not generate random IID only for RAWIP devices



This method is incorrect as it maybe incorrectly clearing some of
the bits needed for setting the IID.

CRs-Fixed: 2233026
Change-Id: I231e9b6a28a0d3f61f3bb19e311432a13bbd4db8
Signed-off-by: default avatarSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>
parent 5faec11e
Loading
Loading
Loading
Loading
+1 −12
Original line number Diff line number Diff line
@@ -2217,16 +2217,6 @@ static int ipv6_generate_eui64(u8 *eui, struct net_device *dev)
	case ARPHRD_TUNNEL6:
	case ARPHRD_IP6GRE:
		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;
}
@@ -3257,8 +3247,7 @@ static void addrconf_dev_config(struct net_device *dev)
	    (dev->type != ARPHRD_IP6GRE) &&
	    (dev->type != ARPHRD_IPGRE) &&
	    (dev->type != ARPHRD_TUNNEL) &&
	    (dev->type != ARPHRD_NONE) &&
	    (dev->type != ARPHRD_RAWIP)) {
	    (dev->type != ARPHRD_NONE)) {
		/* Alas, we support only Ethernet autoconfiguration. */
		return;
	}