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

Commit 796e1112 authored by Johannes Berg's avatar Johannes Berg
Browse files

mac80211_hwsim: fix secondary MAC address assignment



OR'ing in 0x40 before a memcpy() to overwrite the value doesn't
do much good - flip the order of operations are reported and
tested by Jouni.

Fixes: cb1a5bae ("mac80211_hwsim: add permanent mac address option for new radios")
Reported-by: default avatarJouni Malinen <j@w1.fi>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 0466080c
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -2584,8 +2584,8 @@ static int mac80211_hwsim_new_radio(struct genl_info *info,
		addr[4] = idx;
		addr[4] = idx;
		memcpy(data->addresses[0].addr, addr, ETH_ALEN);
		memcpy(data->addresses[0].addr, addr, ETH_ALEN);
		/* Why need here second address ? */
		/* Why need here second address ? */
		data->addresses[1].addr[0] |= 0x40;
		memcpy(data->addresses[1].addr, addr, ETH_ALEN);
		memcpy(data->addresses[1].addr, addr, ETH_ALEN);
		data->addresses[1].addr[0] |= 0x40;
		hw->wiphy->n_addresses = 2;
		hw->wiphy->n_addresses = 2;
		hw->wiphy->addresses = data->addresses;
		hw->wiphy->addresses = data->addresses;
		/* possible address clash is checked at hash table insertion */
		/* possible address clash is checked at hash table insertion */