Skip to content

Commit

Permalink
cfg80211: use only 1Mbps for basic rates in mesh
Browse files Browse the repository at this point in the history
Mesh used to use the mandatory rates as basic rates, but we got
the calculation of mandatory rates wrong until some time ago.
Fix this this broke interoperability with older versions since
now more basic rates are required, and thus the MBSS isn't the
same and the network stops working.

Fix this by simply using only 1Mbps as the basic rate in 2.4GHz.
Since the changed mandatory rates only affected 2.4GHz, this is
all we need to make it work again.

Reported-and-tested-by: Matthias Schiffer <mschiffer@universe-factory.net>
Fixes: 1bd773c ("wireless: set correct mandatory rate flags")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Johannes Berg committed Jan 31, 2018
1 parent ba804bb commit c028c63
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions net/wireless/mesh.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,28 @@ int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev,
enum nl80211_bss_scan_width scan_width;
struct ieee80211_supported_band *sband =
rdev->wiphy.bands[setup->chandef.chan->band];
scan_width = cfg80211_chandef_to_scan_width(&setup->chandef);
setup->basic_rates = ieee80211_mandatory_rates(sband,
scan_width);

if (setup->chandef.chan->band == NL80211_BAND_2GHZ) {
int i;

/*
* Older versions selected the mandatory rates for
* 2.4 GHz as well, but were broken in that only
* 1 Mbps was regarded as a mandatory rate. Keep
* using just 1 Mbps as the default basic rate for
* mesh to be interoperable with older versions.
*/
for (i = 0; i < sband->n_bitrates; i++) {
if (sband->bitrates[i].bitrate == 10) {
setup->basic_rates = BIT(i);
break;
}
}
} else {
scan_width = cfg80211_chandef_to_scan_width(&setup->chandef);
setup->basic_rates = ieee80211_mandatory_rates(sband,
scan_width);
}
}

err = cfg80211_chandef_dfs_required(&rdev->wiphy,
Expand Down

0 comments on commit c028c63

Please sign in to comment.