Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92501a7f authored by Bob Copeland's avatar Bob Copeland Committed by Alistair Strachan
Browse files

UPSTREAM: 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: default avatarBob Copeland <me@bobcopeland.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
(cherry picked from commit cd37a90b2a417e5882414e19954eeed174aa4d29)
Bug: 70214720
Change-Id: I1ece218f9579953a9df8b9f621d5074e2444c651
Signed-off-by: default avatarAlistair Strachan <astrachan@google.com>
parent 393bbf65
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -890,8 +890,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 */
@@ -2420,7 +2419,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;
		}