Commit 71cd7913 authored by Wei Yongjun's avatar Wei Yongjun Committed by Greg Kroah-Hartman

staging: rtl8192e: 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: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ceee26c0
...@@ -2620,13 +2620,7 @@ void rtllib_wake_all_queues(struct rtllib_device *ieee) ...@@ -2620,13 +2620,7 @@ void rtllib_wake_all_queues(struct rtllib_device *ieee)
inline void rtllib_randomize_cell(struct rtllib_device *ieee) inline void rtllib_randomize_cell(struct rtllib_device *ieee)
{ {
get_random_bytes(ieee->current_network.bssid, ETH_ALEN); random_ether_addr(ieee->current_network.bssid);
/* 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;
} }
/* called in user context only */ /* called in user context only */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment