Commit 84826ac7 authored by David S. Miller's avatar David S. Miller

Merge tag 'mac80211-for-davem-2019-02-01' of...

Merge tag 'mac80211-for-davem-2019-02-01' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211

Johannes Berg says:

====================
Two more fixes:
 * sometimes, not enough tailroom was allocated for
   software-encrypted management frames in mac80211
 * cfg80211 regulatory restore got an additional condition,
   needs to rerun the checks after that condition changes
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 294c149a e005bd7d
...@@ -1938,9 +1938,16 @@ static int ieee80211_skb_resize(struct ieee80211_sub_if_data *sdata, ...@@ -1938,9 +1938,16 @@ static int ieee80211_skb_resize(struct ieee80211_sub_if_data *sdata,
int head_need, bool may_encrypt) int head_need, bool may_encrypt)
{ {
struct ieee80211_local *local = sdata->local; struct ieee80211_local *local = sdata->local;
struct ieee80211_hdr *hdr;
bool enc_tailroom;
int tail_need = 0; int tail_need = 0;
if (may_encrypt && sdata->crypto_tx_tailroom_needed_cnt) { hdr = (struct ieee80211_hdr *) skb->data;
enc_tailroom = may_encrypt &&
(sdata->crypto_tx_tailroom_needed_cnt ||
ieee80211_is_mgmt(hdr->frame_control));
if (enc_tailroom) {
tail_need = IEEE80211_ENCRYPT_TAILROOM; tail_need = IEEE80211_ENCRYPT_TAILROOM;
tail_need -= skb_tailroom(skb); tail_need -= skb_tailroom(skb);
tail_need = max_t(int, tail_need, 0); tail_need = max_t(int, tail_need, 0);
...@@ -1948,8 +1955,7 @@ static int ieee80211_skb_resize(struct ieee80211_sub_if_data *sdata, ...@@ -1948,8 +1955,7 @@ static int ieee80211_skb_resize(struct ieee80211_sub_if_data *sdata,
if (skb_cloned(skb) && if (skb_cloned(skb) &&
(!ieee80211_hw_check(&local->hw, SUPPORTS_CLONED_SKBS) || (!ieee80211_hw_check(&local->hw, SUPPORTS_CLONED_SKBS) ||
!skb_clone_writable(skb, ETH_HLEN) || !skb_clone_writable(skb, ETH_HLEN) || enc_tailroom))
(may_encrypt && sdata->crypto_tx_tailroom_needed_cnt)))
I802_DEBUG_INC(local->tx_expand_skb_head_cloned); I802_DEBUG_INC(local->tx_expand_skb_head_cloned);
else if (head_need || tail_need) else if (head_need || tail_need)
I802_DEBUG_INC(local->tx_expand_skb_head); I802_DEBUG_INC(local->tx_expand_skb_head);
......
...@@ -41,6 +41,8 @@ int __cfg80211_stop_ap(struct cfg80211_registered_device *rdev, ...@@ -41,6 +41,8 @@ int __cfg80211_stop_ap(struct cfg80211_registered_device *rdev,
cfg80211_sched_dfs_chan_update(rdev); cfg80211_sched_dfs_chan_update(rdev);
} }
schedule_work(&cfg80211_disconnect_work);
return err; return err;
} }
......
...@@ -445,6 +445,8 @@ void cfg80211_process_wdev_events(struct wireless_dev *wdev); ...@@ -445,6 +445,8 @@ void cfg80211_process_wdev_events(struct wireless_dev *wdev);
bool cfg80211_does_bw_fit_range(const struct ieee80211_freq_range *freq_range, bool cfg80211_does_bw_fit_range(const struct ieee80211_freq_range *freq_range,
u32 center_freq_khz, u32 bw_khz); u32 center_freq_khz, u32 bw_khz);
extern struct work_struct cfg80211_disconnect_work;
/** /**
* cfg80211_chandef_dfs_usable - checks if chandef is DFS usable * cfg80211_chandef_dfs_usable - checks if chandef is DFS usable
* @wiphy: the wiphy to validate against * @wiphy: the wiphy to validate against
......
...@@ -667,7 +667,7 @@ static void disconnect_work(struct work_struct *work) ...@@ -667,7 +667,7 @@ static void disconnect_work(struct work_struct *work)
rtnl_unlock(); rtnl_unlock();
} }
static DECLARE_WORK(cfg80211_disconnect_work, disconnect_work); DECLARE_WORK(cfg80211_disconnect_work, disconnect_work);
/* /*
......
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