提交 418c437d 编写于 作者: S Scott Feldman 提交者: David S. Miller

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: NScott Feldman <scofeldm@cisco.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 6fc7f573
......@@ -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]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册