aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/mesh.c
diff options
context:
space:
mode:
authorMichal Kazior <michal.kazior@tieto.com>2014-01-29 08:22:27 -0500
committerJohannes Berg <johannes.berg@intel.com>2014-02-04 15:58:17 -0500
commit9e0e29615a2077be852b1245b57c5b00fa609522 (patch)
tree73d899373e01efe1fd72a895d8e2fe2f6bc8fcb2 /net/wireless/mesh.c
parentfe94f3a4ffaa20c7470038c69ffc8e545ef5f90a (diff)
cfg80211: consider existing DFS interfaces
It was possible to break interface combinations in the following way: combo 1: iftype = AP, num_ifaces = 2, num_chans = 2, combo 2: iftype = AP, num_ifaces = 1, num_chans = 1, radar = HT20 With the above interface combinations it was possible to: step 1. start AP on DFS channel by matching combo 2 step 2. start AP on non-DFS channel by matching combo 1 This was possible beacuse (step 2) did not consider if other interfaces require radar detection. The patch changes how cfg80211 tracks channels - instead of channel itself now a complete chandef is stored. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/mesh.c')
-rw-r--r--net/wireless/mesh.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/wireless/mesh.c b/net/wireless/mesh.c
index 885862447b63..d42a3fcb2f67 100644
--- a/net/wireless/mesh.c
+++ b/net/wireless/mesh.c
@@ -195,7 +195,7 @@ int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev,
195 if (!err) { 195 if (!err) {
196 memcpy(wdev->ssid, setup->mesh_id, setup->mesh_id_len); 196 memcpy(wdev->ssid, setup->mesh_id, setup->mesh_id_len);
197 wdev->mesh_id_len = setup->mesh_id_len; 197 wdev->mesh_id_len = setup->mesh_id_len;
198 wdev->channel = setup->chandef.chan; 198 wdev->chandef = setup->chandef;
199 } 199 }
200 200
201 return err; 201 return err;
@@ -244,7 +244,7 @@ int cfg80211_set_mesh_channel(struct cfg80211_registered_device *rdev,
244 err = rdev_libertas_set_mesh_channel(rdev, wdev->netdev, 244 err = rdev_libertas_set_mesh_channel(rdev, wdev->netdev,
245 chandef->chan); 245 chandef->chan);
246 if (!err) 246 if (!err)
247 wdev->channel = chandef->chan; 247 wdev->chandef = *chandef;
248 248
249 return err; 249 return err;
250 } 250 }
@@ -276,7 +276,7 @@ static int __cfg80211_leave_mesh(struct cfg80211_registered_device *rdev,
276 err = rdev_leave_mesh(rdev, dev); 276 err = rdev_leave_mesh(rdev, dev);
277 if (!err) { 277 if (!err) {
278 wdev->mesh_id_len = 0; 278 wdev->mesh_id_len = 0;
279 wdev->channel = NULL; 279 memset(&wdev->chandef, 0, sizeof(wdev->chandef));
280 rdev_set_qos_map(rdev, dev, NULL); 280 rdev_set_qos_map(rdev, dev, NULL);
281 } 281 }
282 282