From: Scott Feldman Date: Sat, 22 May 2010 17:29:58 +0000 (+0000) Subject: enic: Use random mac addr when associating port-profile X-Git-Tag: upstream/snapshot3+hdmi~13834^2~236 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=418c437d8b4b87815f3afed89da2aa0078d5379d;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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: Scott Feldman Signed-off-by: David S. Miller --- diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index 7e97323..6586b5c 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -1132,6 +1132,14 @@ static int enic_set_vf_port(struct net_device *netdev, int vf, switch (request) { 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]) name = nla_data(port[IFLA_PORT_PROFILE]);