aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/cfg.c9
-rw-r--r--net/mac80211/mesh.c3
-rw-r--r--net/mac80211/mlme.c6
-rw-r--r--net/mac80211/scan.c3
-rw-r--r--net/mac80211/tx.c38
-rw-r--r--net/wireless/nl80211.c4
-rw-r--r--net/wireless/reg.c19
7 files changed, 51 insertions, 31 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 929f897a8ded..03fe6d1cff42 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1389,6 +1389,8 @@ static void mpath_set_pinfo(struct mesh_path *mpath, u8 *next_hop,
1389 else 1389 else
1390 memset(next_hop, 0, ETH_ALEN); 1390 memset(next_hop, 0, ETH_ALEN);
1391 1391
1392 memset(pinfo, 0, sizeof(*pinfo));
1393
1392 pinfo->generation = mesh_paths_generation; 1394 pinfo->generation = mesh_paths_generation;
1393 1395
1394 pinfo->filled = MPATH_INFO_FRAME_QLEN | 1396 pinfo->filled = MPATH_INFO_FRAME_QLEN |
@@ -1407,7 +1409,6 @@ static void mpath_set_pinfo(struct mesh_path *mpath, u8 *next_hop,
1407 pinfo->discovery_timeout = 1409 pinfo->discovery_timeout =
1408 jiffies_to_msecs(mpath->discovery_timeout); 1410 jiffies_to_msecs(mpath->discovery_timeout);
1409 pinfo->discovery_retries = mpath->discovery_retries; 1411 pinfo->discovery_retries = mpath->discovery_retries;
1410 pinfo->flags = 0;
1411 if (mpath->flags & MESH_PATH_ACTIVE) 1412 if (mpath->flags & MESH_PATH_ACTIVE)
1412 pinfo->flags |= NL80211_MPATH_FLAG_ACTIVE; 1413 pinfo->flags |= NL80211_MPATH_FLAG_ACTIVE;
1413 if (mpath->flags & MESH_PATH_RESOLVING) 1414 if (mpath->flags & MESH_PATH_RESOLVING)
@@ -1416,10 +1417,8 @@ static void mpath_set_pinfo(struct mesh_path *mpath, u8 *next_hop,
1416 pinfo->flags |= NL80211_MPATH_FLAG_SN_VALID; 1417 pinfo->flags |= NL80211_MPATH_FLAG_SN_VALID;
1417 if (mpath->flags & MESH_PATH_FIXED) 1418 if (mpath->flags & MESH_PATH_FIXED)
1418 pinfo->flags |= NL80211_MPATH_FLAG_FIXED; 1419 pinfo->flags |= NL80211_MPATH_FLAG_FIXED;
1419 if (mpath->flags & MESH_PATH_RESOLVING) 1420 if (mpath->flags & MESH_PATH_RESOLVED)
1420 pinfo->flags |= NL80211_MPATH_FLAG_RESOLVING; 1421 pinfo->flags |= NL80211_MPATH_FLAG_RESOLVED;
1421
1422 pinfo->flags = mpath->flags;
1423} 1422}
1424 1423
1425static int ieee80211_get_mpath(struct wiphy *wiphy, struct net_device *dev, 1424static int ieee80211_get_mpath(struct wiphy *wiphy, struct net_device *dev,
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index f2d0d213bcfb..5f37add1571e 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -632,6 +632,7 @@ void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata)
632 632
633 del_timer_sync(&sdata->u.mesh.housekeeping_timer); 633 del_timer_sync(&sdata->u.mesh.housekeeping_timer);
634 del_timer_sync(&sdata->u.mesh.mesh_path_root_timer); 634 del_timer_sync(&sdata->u.mesh.mesh_path_root_timer);
635 del_timer_sync(&sdata->u.mesh.mesh_path_timer);
635 /* 636 /*
636 * If the timer fired while we waited for it, it will have 637 * If the timer fired while we waited for it, it will have
637 * requeued the work. Now the work will be running again 638 * requeued the work. Now the work will be running again
@@ -644,6 +645,8 @@ void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata)
644 local->fif_other_bss--; 645 local->fif_other_bss--;
645 atomic_dec(&local->iff_allmultis); 646 atomic_dec(&local->iff_allmultis);
646 ieee80211_configure_filter(local); 647 ieee80211_configure_filter(local);
648
649 sdata->u.mesh.timers_running = 0;
647} 650}
648 651
649static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata, 652static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index b65b2149b23b..5d77650d4363 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1467,6 +1467,8 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
1467 del_timer_sync(&sdata->u.mgd.bcn_mon_timer); 1467 del_timer_sync(&sdata->u.mgd.bcn_mon_timer);
1468 del_timer_sync(&sdata->u.mgd.timer); 1468 del_timer_sync(&sdata->u.mgd.timer);
1469 del_timer_sync(&sdata->u.mgd.chswitch_timer); 1469 del_timer_sync(&sdata->u.mgd.chswitch_timer);
1470
1471 sdata->u.mgd.timers_running = 0;
1470} 1472}
1471 1473
1472void ieee80211_sta_rx_notify(struct ieee80211_sub_if_data *sdata, 1474void ieee80211_sta_rx_notify(struct ieee80211_sub_if_data *sdata,
@@ -3298,6 +3300,8 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
3298 goto out_unlock; 3300 goto out_unlock;
3299 3301
3300 err_clear: 3302 err_clear:
3303 memset(ifmgd->bssid, 0, ETH_ALEN);
3304 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BSSID);
3301 ifmgd->auth_data = NULL; 3305 ifmgd->auth_data = NULL;
3302 err_free: 3306 err_free:
3303 kfree(auth_data); 3307 kfree(auth_data);
@@ -3506,6 +3510,8 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
3506 err = 0; 3510 err = 0;
3507 goto out; 3511 goto out;
3508 err_clear: 3512 err_clear:
3513 memset(ifmgd->bssid, 0, ETH_ALEN);
3514 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BSSID);
3509 ifmgd->assoc_data = NULL; 3515 ifmgd->assoc_data = NULL;
3510 err_free: 3516 err_free:
3511 kfree(assoc_data); 3517 kfree(assoc_data);
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index ef1d69306315..740e414d44f4 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -299,7 +299,7 @@ static void __ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted,
299 if (local->scan_req != local->int_scan_req) 299 if (local->scan_req != local->int_scan_req)
300 cfg80211_scan_done(local->scan_req, aborted); 300 cfg80211_scan_done(local->scan_req, aborted);
301 local->scan_req = NULL; 301 local->scan_req = NULL;
302 local->scan_sdata = NULL; 302 rcu_assign_pointer(local->scan_sdata, NULL);
303 303
304 local->scanning = 0; 304 local->scanning = 0;
305 local->scan_channel = NULL; 305 local->scan_channel = NULL;
@@ -984,7 +984,6 @@ int ieee80211_request_sched_scan_stop(struct ieee80211_sub_if_data *sdata)
984 kfree(local->sched_scan_ies.ie[i]); 984 kfree(local->sched_scan_ies.ie[i]);
985 985
986 drv_sched_scan_stop(local, sdata); 986 drv_sched_scan_stop(local, sdata);
987 rcu_assign_pointer(local->sched_scan_sdata, NULL);
988 } 987 }
989out: 988out:
990 mutex_unlock(&local->mtx); 989 mutex_unlock(&local->mtx);
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 3b807bcb8fc9..29eb4e678235 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1807,37 +1807,31 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
1807 meshhdrlen = ieee80211_new_mesh_header(&mesh_hdr, 1807 meshhdrlen = ieee80211_new_mesh_header(&mesh_hdr,
1808 sdata, NULL, NULL); 1808 sdata, NULL, NULL);
1809 } else { 1809 } else {
1810 int is_mesh_mcast = 1; 1810 /* DS -> MBSS (802.11-2012 13.11.3.3).
1811 const u8 *mesh_da; 1811 * For unicast with unknown forwarding information,
1812 * destination might be in the MBSS or if that fails
1813 * forwarded to another mesh gate. In either case
1814 * resolution will be handled in ieee80211_xmit(), so
1815 * leave the original DA. This also works for mcast */
1816 const u8 *mesh_da = skb->data;
1817
1818 if (mppath)
1819 mesh_da = mppath->mpp;
1820 else if (mpath)
1821 mesh_da = mpath->dst;
1822 rcu_read_unlock();
1812 1823
1813 if (is_multicast_ether_addr(skb->data))
1814 /* DA TA mSA AE:SA */
1815 mesh_da = skb->data;
1816 else {
1817 static const u8 bcast[ETH_ALEN] =
1818 { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
1819 if (mppath) {
1820 /* RA TA mDA mSA AE:DA SA */
1821 mesh_da = mppath->mpp;
1822 is_mesh_mcast = 0;
1823 } else if (mpath) {
1824 mesh_da = mpath->dst;
1825 is_mesh_mcast = 0;
1826 } else {
1827 /* DA TA mSA AE:SA */
1828 mesh_da = bcast;
1829 }
1830 }
1831 hdrlen = ieee80211_fill_mesh_addresses(&hdr, &fc, 1824 hdrlen = ieee80211_fill_mesh_addresses(&hdr, &fc,
1832 mesh_da, sdata->vif.addr); 1825 mesh_da, sdata->vif.addr);
1833 rcu_read_unlock(); 1826 if (is_multicast_ether_addr(mesh_da))
1834 if (is_mesh_mcast) 1827 /* DA TA mSA AE:SA */
1835 meshhdrlen = 1828 meshhdrlen =
1836 ieee80211_new_mesh_header(&mesh_hdr, 1829 ieee80211_new_mesh_header(&mesh_hdr,
1837 sdata, 1830 sdata,
1838 skb->data + ETH_ALEN, 1831 skb->data + ETH_ALEN,
1839 NULL); 1832 NULL);
1840 else 1833 else
1834 /* RA TA mDA mSA AE:DA SA */
1841 meshhdrlen = 1835 meshhdrlen =
1842 ieee80211_new_mesh_header(&mesh_hdr, 1836 ieee80211_new_mesh_header(&mesh_hdr,
1843 sdata, 1837 sdata,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 787aeaa902fe..222189b6ed53 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -5656,8 +5656,10 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info)
5656 sizeof(connect.ht_capa_mask)); 5656 sizeof(connect.ht_capa_mask));
5657 5657
5658 if (info->attrs[NL80211_ATTR_HT_CAPABILITY]) { 5658 if (info->attrs[NL80211_ATTR_HT_CAPABILITY]) {
5659 if (!info->attrs[NL80211_ATTR_HT_CAPABILITY_MASK]) 5659 if (!info->attrs[NL80211_ATTR_HT_CAPABILITY_MASK]) {
5660 kfree(connkeys);
5660 return -EINVAL; 5661 return -EINVAL;
5662 }
5661 memcpy(&connect.ht_capa, 5663 memcpy(&connect.ht_capa,
5662 nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY]), 5664 nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY]),
5663 sizeof(connect.ht_capa)); 5665 sizeof(connect.ht_capa));
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index c6e0d467f8bd..1ad04e54014c 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -680,6 +680,8 @@ static u32 map_regdom_flags(u32 rd_flags)
680 channel_flags |= IEEE80211_CHAN_NO_IBSS; 680 channel_flags |= IEEE80211_CHAN_NO_IBSS;
681 if (rd_flags & NL80211_RRF_DFS) 681 if (rd_flags & NL80211_RRF_DFS)
682 channel_flags |= IEEE80211_CHAN_RADAR; 682 channel_flags |= IEEE80211_CHAN_RADAR;
683 if (rd_flags & NL80211_RRF_NO_OFDM)
684 channel_flags |= IEEE80211_CHAN_NO_OFDM;
683 return channel_flags; 685 return channel_flags;
684} 686}
685 687
@@ -901,7 +903,21 @@ static void handle_channel(struct wiphy *wiphy,
901 chan->max_antenna_gain = min(chan->orig_mag, 903 chan->max_antenna_gain = min(chan->orig_mag,
902 (int) MBI_TO_DBI(power_rule->max_antenna_gain)); 904 (int) MBI_TO_DBI(power_rule->max_antenna_gain));
903 chan->max_reg_power = (int) MBM_TO_DBM(power_rule->max_eirp); 905 chan->max_reg_power = (int) MBM_TO_DBM(power_rule->max_eirp);
904 chan->max_power = min(chan->max_power, chan->max_reg_power); 906 if (chan->orig_mpwr) {
907 /*
908 * Devices that have their own custom regulatory domain
909 * but also use WIPHY_FLAG_STRICT_REGULATORY will follow the
910 * passed country IE power settings.
911 */
912 if (initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE &&
913 wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY &&
914 wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY)
915 chan->max_power = chan->max_reg_power;
916 else
917 chan->max_power = min(chan->orig_mpwr,
918 chan->max_reg_power);
919 } else
920 chan->max_power = chan->max_reg_power;
905} 921}
906 922
907static void handle_band(struct wiphy *wiphy, 923static void handle_band(struct wiphy *wiphy,
@@ -1885,6 +1901,7 @@ static void restore_custom_reg_settings(struct wiphy *wiphy)
1885 chan->flags = chan->orig_flags; 1901 chan->flags = chan->orig_flags;
1886 chan->max_antenna_gain = chan->orig_mag; 1902 chan->max_antenna_gain = chan->orig_mag;
1887 chan->max_power = chan->orig_mpwr; 1903 chan->max_power = chan->orig_mpwr;
1904 chan->beacon_found = false;
1888 } 1905 }
1889 } 1906 }
1890} 1907}