提交 914828fa 编写于 作者: J Jouni Malinen 提交者: John W. Linville

mac80211: Fix TX status reporting for injected data frames

An earlier optimization on removing unnecessary traffic on cooked
monitor interfaces ("mac80211: reduce the amount of unnecessary traffic
on cooked monitor interfaces ") ended up removing quite a bit more
than just unnecessary traffic. It was not supposed to remove TX status
reporting for injected frames, but ended up doing it by checking the
injected flag in skb->cb only after that field had been cleared with
memset.. Fix this by taking a local copy of the injected flag before
skb->cb is cleared.

This broke user space applications that depend on getting TX status
notifications for injected data frames. For example, STA inactivity
poll from hostapd did not work and ended up kicking out stations even
if they were still present.
Signed-off-by: NJouni Malinen <j@w1.fi>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 a9a29ce6
...@@ -148,6 +148,7 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) ...@@ -148,6 +148,7 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
struct net_device *prev_dev = NULL; struct net_device *prev_dev = NULL;
struct sta_info *sta; struct sta_info *sta;
int retry_count = -1, i; int retry_count = -1, i;
bool injected;
for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) { for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) {
/* the HW cannot have attempted that rate */ /* the HW cannot have attempted that rate */
...@@ -297,6 +298,9 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) ...@@ -297,6 +298,9 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
/* for now report the total retry_count */ /* for now report the total retry_count */
rthdr->data_retries = retry_count; rthdr->data_retries = retry_count;
/* Need to make a copy before skb->cb gets cleared */
injected = !!(info->flags & IEEE80211_TX_CTL_INJECTED);
/* XXX: is this sufficient for BPF? */ /* XXX: is this sufficient for BPF? */
skb_set_mac_header(skb, 0); skb_set_mac_header(skb, 0);
skb->ip_summed = CHECKSUM_UNNECESSARY; skb->ip_summed = CHECKSUM_UNNECESSARY;
...@@ -311,7 +315,7 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) ...@@ -311,7 +315,7 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
continue; continue;
if ((sdata->u.mntr_flags & MONITOR_FLAG_COOK_FRAMES) && if ((sdata->u.mntr_flags & MONITOR_FLAG_COOK_FRAMES) &&
!(info->flags & IEEE80211_TX_CTL_INJECTED) && !injected &&
(type == IEEE80211_FTYPE_DATA)) (type == IEEE80211_FTYPE_DATA))
continue; continue;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册