Message ID | 20100523032957.20200.59700.stgit@savbu-pc100.cisco.com |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
From: Scott Feldman <scofeldm@cisco.com> Date: Sat, 22 May 2010 20:29:58 -0700 > From: Scott Feldman <scofeldm@cisco.com> > > 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 <scofeldm@cisco.com> Applied. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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]);