]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mac80211_hwsim: support any address in userspace
authorBob Copeland <me@bobcopeland.com>
Tue, 24 Feb 2015 13:39:44 +0000 (08:39 -0500)
committerJohannes Berg <johannes.berg@intel.com>
Sat, 28 Feb 2015 20:31:10 +0000 (21:31 +0100)
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>
drivers/net/wireless/mac80211_hwsim.c

index 4a4c6586a8d2dcda2b6f49a5b767bcc48304e138..e259ee174a0dd4795085482546c0b86d5fe79c8f 100644 (file)
@@ -906,8 +906,7 @@ static void mac80211_hwsim_tx_frame_nl(struct ieee80211_hw *hw,
                goto nla_put_failure;
        }
 
-       if (nla_put(skb, HWSIM_ATTR_ADDR_TRANSMITTER,
-                   ETH_ALEN, data->addresses[1].addr))
+       if (nla_put(skb, HWSIM_ATTR_ADDR_TRANSMITTER, ETH_ALEN, hdr->addr2))
                goto nla_put_failure;
 
        /* We get the skb->data */
@@ -2608,7 +2607,7 @@ static struct mac80211_hwsim_data *get_hwsim_data_ref_from_addr(const u8 *addr)
 
        spin_lock_bh(&hwsim_radio_lock);
        list_for_each_entry(data, &hwsim_radios, list) {
-               if (memcmp(data->addresses[1].addr, addr, ETH_ALEN) == 0) {
+               if (mac80211_hwsim_addr_match(data, addr)) {
                        _found = true;
                        break;
                }