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

Commit 418c437d authored by Scott Feldman's avatar Scott Feldman Committed by David S. Miller
Browse files

enic: Use random mac addr when associating port-profile



Use random mac addr for interface when associating port-profile to
dynamic enic device, in the case no mac addr was previous assigned.

Signed-off-by: default avatarScott Feldman <scofeldm@cisco.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6fc7f573
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -1132,6 +1132,14 @@ static int enic_set_vf_port(struct net_device *netdev, int vf,
	switch (request) {
	switch (request) {
	case PORT_REQUEST_ASSOCIATE:
	case PORT_REQUEST_ASSOCIATE:


		/* If the interface mac addr hasn't been assigned,
		 * assign a random mac addr before setting port-
		 * profile.
		 */

		if (is_zero_ether_addr(netdev->dev_addr))
			random_ether_addr(netdev->dev_addr);

		if (port[IFLA_PORT_PROFILE])
		if (port[IFLA_PORT_PROFILE])
			name = nla_data(port[IFLA_PORT_PROFILE]);
			name = nla_data(port[IFLA_PORT_PROFILE]);