summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2012-08-21 16:36:28 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-04 14:10:08 -0700
commitceee26c0e09ee6df22563bf01aa6b29bd1e5c0de (patch)
tree088efed99908f16b9ff1217a21c377d2c929825f /drivers/staging
parentb4797fef980664ea5923b24795ed365177d68525 (diff)
staging: rtl8187se: using random_ether_addr() to generate random MAC
Using random_ether_addr() to generate a random Ethernet address (MAC) that is not multicast and has the local assigned bit set. Not need to duplicating its implementation. spatch with a semantic match is used to found this problem. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
index 7c669a23f7cf..00f9af06aca5 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
@@ -2111,13 +2111,7 @@ void ieee80211_rtl_stop_queue(struct ieee80211_device *ieee)
inline void ieee80211_randomize_cell(struct ieee80211_device *ieee)
{
- get_random_bytes(ieee->current_network.bssid, ETH_ALEN);
-
- /* an IBSS cell address must have the two less significant
- * bits of the first byte = 2
- */
- ieee->current_network.bssid[0] &= ~0x01;
- ieee->current_network.bssid[0] |= 0x02;
+ random_ether_addr(ieee->current_network.bssid);
}
/* called in user context only */