Commit 65f7052b authored by Johannes Berg's avatar Johannes Berg

wifi: mac80211_hwsim: fix link change handling

The code for determining which links to update in wmediumd
or virtio was wrong, fix it to remove the deflink only if
there were no old links, and also add the deflink if there
are no other new links.

Fixes: c204d9df ("wifi: mac80211_hwsim: handle links for wmediumd/virtio")
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent c73993b8
...@@ -2995,10 +2995,15 @@ static int mac80211_hwsim_change_vif_links(struct ieee80211_hw *hw, ...@@ -2995,10 +2995,15 @@ static int mac80211_hwsim_change_vif_links(struct ieee80211_hw *hw,
u16 old_links, u16 new_links, u16 old_links, u16 new_links,
struct ieee80211_bss_conf *old[IEEE80211_MLD_MAX_NUM_LINKS]) struct ieee80211_bss_conf *old[IEEE80211_MLD_MAX_NUM_LINKS])
{ {
unsigned long rem = old_links & ~new_links ?: BIT(0); unsigned long rem = old_links & ~new_links;
unsigned long add = new_links & ~old_links; unsigned long add = new_links & ~old_links;
int i; int i;
if (!old_links)
rem |= BIT(0);
if (!new_links)
add |= BIT(0);
for_each_set_bit(i, &rem, IEEE80211_MLD_MAX_NUM_LINKS) for_each_set_bit(i, &rem, IEEE80211_MLD_MAX_NUM_LINKS)
mac80211_hwsim_config_mac_nl(hw, old[i]->addr, false); mac80211_hwsim_config_mac_nl(hw, old[i]->addr, false);
......
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