diff options
author | Scott Feldman <scofeldm@cisco.com> | 2010-05-22 19:29:58 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-05-24 08:11:06 +0200 |
commit | 418c437d8b4b87815f3afed89da2aa0078d5379d (patch) | |
tree | e363be0d21c3209cae767490e7aad4732602b7b2 /drivers/net/enic | |
parent | enic: bug fix: sprintf UUID to string as u8[] rather than u16[] array (diff) | |
download | linux-418c437d8b4b87815f3afed89da2aa0078d5379d.tar.xz linux-418c437d8b4b87815f3afed89da2aa0078d5379d.zip |
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 <scofeldm@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/enic')
-rw-r--r-- | drivers/net/enic/enic_main.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index 7e973237bf98..6586b5c7e4b6 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]); |