aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Copeland <me@bobcopeland.com>2015-02-24 08:39:44 -0500
committerJohannes Berg <johannes.berg@intel.com>2015-02-28 15:31:10 -0500
commitcd37a90b2a417e5882414e19954eeed174aa4d29 (patch)
tree9f106dc21e51beeb5d23622c6b5bcca969779b1b
parent2afe38d15cee01b2bb8f22383571f7f4a95f2d99 (diff)
mac80211_hwsim: support any address in userspace
Due to the checks in get_hwsim_data_ref_from_addr, wmediumd was only able to use the second mac address (those starting with 0x42). This is confusing and needlessly limiting, so allow any configured address. Signed-off-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 4a4c6586a8d2..e259ee174a0d 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -906,8 +906,7 @@ static void mac80211_hwsim_tx_frame_nl(struct ieee80211_hw *hw,
906 goto nla_put_failure; 906 goto nla_put_failure;
907 } 907 }
908 908
909 if (nla_put(skb, HWSIM_ATTR_ADDR_TRANSMITTER, 909 if (nla_put(skb, HWSIM_ATTR_ADDR_TRANSMITTER, ETH_ALEN, hdr->addr2))
910 ETH_ALEN, data->addresses[1].addr))
911 goto nla_put_failure; 910 goto nla_put_failure;
912 911
913 /* We get the skb->data */ 912 /* We get the skb->data */
@@ -2608,7 +2607,7 @@ static struct mac80211_hwsim_data *get_hwsim_data_ref_from_addr(const u8 *addr)
2608 2607
2609 spin_lock_bh(&hwsim_radio_lock); 2608 spin_lock_bh(&hwsim_radio_lock);
2610 list_for_each_entry(data, &hwsim_radios, list) { 2609 list_for_each_entry(data, &hwsim_radios, list) {
2611 if (memcmp(data->addresses[1].addr, addr, ETH_ALEN) == 0) { 2610 if (mac80211_hwsim_addr_match(data, addr)) {
2612 _found = true; 2611 _found = true;
2613 break; 2612 break;
2614 } 2613 }