1 --- a/net/mac80211/rx.c
2 +++ b/net/mac80211/rx.c
3 @@ -1582,7 +1582,7 @@ ieee80211_drop_unencrypted_mgmt(struct i
7 -__ieee80211_data_to_8023(struct ieee80211_rx_data *rx)
8 +__ieee80211_data_to_8023(struct ieee80211_rx_data *rx, bool *port_control)
10 struct ieee80211_sub_if_data *sdata = rx->sdata;
11 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data;
12 @@ -1590,6 +1590,7 @@ __ieee80211_data_to_8023(struct ieee8021
16 + *port_control = false;
17 if (ieee80211_has_a4(hdr->frame_control) &&
18 sdata->vif.type == NL80211_IFTYPE_AP_VLAN && !sdata->u.vlan.sta)
20 @@ -1608,11 +1609,14 @@ __ieee80211_data_to_8023(struct ieee8021
23 ret = ieee80211_data_to_8023(rx->skb, sdata->vif.addr, sdata->vif.type);
24 - if (ret < 0 || !check_port_control)
28 ehdr = (struct ethhdr *) rx->skb->data;
29 - if (ehdr->h_proto != rx->sdata->control_port_protocol)
30 + if (ehdr->h_proto == rx->sdata->control_port_protocol)
31 + *port_control = true;
33 + if (check_port_control && !*port_control)
37 @@ -1913,6 +1917,7 @@ ieee80211_rx_h_data(struct ieee80211_rx_
38 struct net_device *dev = sdata->dev;
39 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data;
40 __le16 fc = hdr->frame_control;
44 if (unlikely(!ieee80211_is_data(hdr->frame_control)))
45 @@ -1929,13 +1934,21 @@ ieee80211_rx_h_data(struct ieee80211_rx_
46 sdata->vif.type == NL80211_IFTYPE_AP)
47 return RX_DROP_MONITOR;
49 - err = __ieee80211_data_to_8023(rx);
50 + err = __ieee80211_data_to_8023(rx, &port_control);
52 return RX_DROP_UNUSABLE;
54 if (!ieee80211_frame_allowed(rx, fc))
55 return RX_DROP_MONITOR;
57 + if (rx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN &&
58 + unlikely(port_control) && sdata->bss) {
59 + sdata = container_of(sdata->bss, struct ieee80211_sub_if_data,
67 dev->stats.rx_packets++;