Skip to content

Commit

Permalink
wifi: mac80211: fix decap offload for stations on AP_VLAN interfaces
Browse files Browse the repository at this point in the history
Since AP_VLAN interfaces are not passed to the driver, check offload_flags
on the bss vif instead.

Reported-by: Howard Hsu <[email protected]>
Fixes: 80a915e ("mac80211: add rx decapsulation offload support")
Signed-off-by: Felix Fietkau <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
  • Loading branch information
nbd168 authored and jmberg-intel committed Oct 7, 2022
1 parent ceb3d68 commit 3bf9e30
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions net/mac80211/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -4352,6 +4352,7 @@ void ieee80211_check_fast_rx(struct sta_info *sta)
.vif_type = sdata->vif.type,
.control_port_protocol = sdata->control_port_protocol,
}, *old, *new = NULL;
u32 offload_flags;
bool set_offload = false;
bool assign = false;
bool offload;
Expand Down Expand Up @@ -4467,10 +4468,10 @@ void ieee80211_check_fast_rx(struct sta_info *sta)
if (assign)
new = kmemdup(&fastrx, sizeof(fastrx), GFP_KERNEL);

offload = assign &&
(sdata->vif.offload_flags & IEEE80211_OFFLOAD_DECAP_ENABLED);
offload_flags = get_bss_sdata(sdata)->vif.offload_flags;
offload = offload_flags & IEEE80211_OFFLOAD_DECAP_ENABLED;

if (offload)
if (assign && offload)
set_offload = !test_and_set_sta_flag(sta, WLAN_STA_DECAP_OFFLOAD);
else
set_offload = test_and_clear_sta_flag(sta, WLAN_STA_DECAP_OFFLOAD);
Expand Down

0 comments on commit 3bf9e30

Please sign in to comment.