Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 236744
b: refs/heads/master
c: fbb327c
h: refs/heads/master
v: v3
  • Loading branch information
Felix Fietkau authored and John W. Linville committed Jan 19, 2011
1 parent 978b10f commit e3e9f80
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5dd36bc933e8be84f8369ac64505a2938f9ce036
refs/heads/master: fbb327c5945448e98480d610815143a6d4a63638
25 changes: 22 additions & 3 deletions trunk/net/mac80211/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1556,17 +1556,36 @@ __ieee80211_data_to_8023(struct ieee80211_rx_data *rx)
{
struct ieee80211_sub_if_data *sdata = rx->sdata;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data;
bool check_port_control = false;
struct ethhdr *ehdr;
int ret;

if (ieee80211_has_a4(hdr->frame_control) &&
sdata->vif.type == NL80211_IFTYPE_AP_VLAN && !sdata->u.vlan.sta)
return -1;

if (sdata->vif.type == NL80211_IFTYPE_STATION &&
!!sdata->u.mgd.use_4addr != !!ieee80211_has_a4(hdr->frame_control)) {

if (!sdata->u.mgd.use_4addr)
return -1;
else
check_port_control = true;
}

if (is_multicast_ether_addr(hdr->addr1) &&
((sdata->vif.type == NL80211_IFTYPE_AP_VLAN && sdata->u.vlan.sta) ||
(sdata->vif.type == NL80211_IFTYPE_STATION && sdata->u.mgd.use_4addr)))
sdata->vif.type == NL80211_IFTYPE_AP_VLAN && sdata->u.vlan.sta)
return -1;

return ieee80211_data_to_8023(rx->skb, sdata->vif.addr, sdata->vif.type);
ret = ieee80211_data_to_8023(rx->skb, sdata->vif.addr, sdata->vif.type);
if (ret < 0 || !check_port_control)
return ret;

ehdr = (struct ethhdr *) rx->skb->data;
if (ehdr->h_proto != rx->sdata->control_port_protocol)
return -1;

return 0;
}

/*
Expand Down

0 comments on commit e3e9f80

Please sign in to comment.