Message ID | 20200622083054.102643-1-markus.theil@tu-ilmenau.de (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Johannes Berg |
Headers | show |
Series | mac80211: fix control port tx status check | expand |
On Mon, 2020-06-22 at 10:30 +0200, Markus Theil wrote: > Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de> > --- > net/mac80211/status.c | 21 ++++++++++++++------- > 1 file changed, 14 insertions(+), 7 deletions(-) > > diff --git a/net/mac80211/status.c b/net/mac80211/status.c > index 7b1bacac39c6..88c826645903 100644 > --- a/net/mac80211/status.c > +++ b/net/mac80211/status.c > @@ -639,11 +639,22 @@ static void ieee80211_report_ack_skb(struct ieee80211_local *local, > u64 cookie = IEEE80211_SKB_CB(skb)->ack.cookie; > struct ieee80211_sub_if_data *sdata; > struct ieee80211_hdr *hdr = (void *)skb->data; > + u16 ethertype = 0xffff; > + > + if (skb->protocol == cpu_to_be16(ETH_P_802_3) && skb->len >= 14) > + ethertype = (skb->data[12] << 8) | skb->data[13]; Might be nicer to extract that as __be16 immediately? johannes
On 6/22/20 10:33 AM, Johannes Berg wrote: > On Mon, 2020-06-22 at 10:30 +0200, Markus Theil wrote: >> Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de> >> --- >> net/mac80211/status.c | 21 ++++++++++++++------- >> 1 file changed, 14 insertions(+), 7 deletions(-) >> >> diff --git a/net/mac80211/status.c b/net/mac80211/status.c >> index 7b1bacac39c6..88c826645903 100644 >> --- a/net/mac80211/status.c >> +++ b/net/mac80211/status.c >> @@ -639,11 +639,22 @@ static void ieee80211_report_ack_skb(struct ieee80211_local *local, >> u64 cookie = IEEE80211_SKB_CB(skb)->ack.cookie; >> struct ieee80211_sub_if_data *sdata; >> struct ieee80211_hdr *hdr = (void *)skb->data; >> + u16 ethertype = 0xffff; >> + >> + if (skb->protocol == cpu_to_be16(ETH_P_802_3) && skb->len >= 14) >> + ethertype = (skb->data[12] << 8) | skb->data[13]; > Might be nicer to extract that as __be16 immediately? > > johannes > > Makes sense. I'll send an update.
diff --git a/net/mac80211/status.c b/net/mac80211/status.c index 7b1bacac39c6..88c826645903 100644 --- a/net/mac80211/status.c +++ b/net/mac80211/status.c @@ -639,11 +639,22 @@ static void ieee80211_report_ack_skb(struct ieee80211_local *local, u64 cookie = IEEE80211_SKB_CB(skb)->ack.cookie; struct ieee80211_sub_if_data *sdata; struct ieee80211_hdr *hdr = (void *)skb->data; + u16 ethertype = 0xffff; + + if (skb->protocol == cpu_to_be16(ETH_P_802_3) && skb->len >= 14) + ethertype = (skb->data[12] << 8) | skb->data[13]; rcu_read_lock(); sdata = ieee80211_sdata_from_skb(local, skb); if (sdata) { - if (ieee80211_is_any_nullfunc(hdr->frame_control)) + if (cpu_to_be16(ethertype) == sdata->control_port_protocol) + cfg80211_control_port_tx_status(&sdata->wdev, + cookie, + skb->data, + skb->len, + acked, + GFP_ATOMIC); + else if (ieee80211_is_any_nullfunc(hdr->frame_control)) cfg80211_probe_status(sdata->dev, hdr->addr1, cookie, acked, info->status.ack_signal, @@ -654,12 +665,8 @@ static void ieee80211_report_ack_skb(struct ieee80211_local *local, skb->data, skb->len, acked, GFP_ATOMIC); else - cfg80211_control_port_tx_status(&sdata->wdev, - cookie, - skb->data, - skb->len, - acked, - GFP_ATOMIC); + pr_warn("Unknown status report in ack skb\n"); + } rcu_read_unlock();
Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de> --- net/mac80211/status.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)