Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 102968
b: refs/heads/master
c: a494bb1
h: refs/heads/master
v: v3
  • Loading branch information
Harvey Harrison authored and John W. Linville committed Jun 14, 2008
1 parent 9c501f7 commit b1b20ed
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 23 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: d5184cacf3eeaeb6ae0c7a02aa44fe589beeda23
refs/heads/master: a494bb1cae40dd0a98682826d91ddf533cbc864e
41 changes: 19 additions & 22 deletions trunk/net/mac80211/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,50 +45,47 @@ const unsigned char bridge_tunnel_header[] __aligned(2) =
u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len,
enum ieee80211_if_types type)
{
u16 fc;
__le16 fc = hdr->frame_control;

/* drop ACK/CTS frames and incorrect hdr len (ctrl) */
if (len < 16)
return NULL;

fc = le16_to_cpu(hdr->frame_control);

switch (fc & IEEE80211_FCTL_FTYPE) {
case IEEE80211_FTYPE_DATA:
if (ieee80211_is_data(fc)) {
if (len < 24) /* drop incorrect hdr len (data) */
return NULL;
switch (fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) {
case IEEE80211_FCTL_TODS:
return hdr->addr1;
case (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS):

if (ieee80211_has_a4(fc))
return NULL;
case IEEE80211_FCTL_FROMDS:
if (ieee80211_has_tods(fc))
return hdr->addr1;
if (ieee80211_has_fromds(fc))
return hdr->addr2;
case 0:
return hdr->addr3;
}
break;
case IEEE80211_FTYPE_MGMT:

return hdr->addr3;
}

if (ieee80211_is_mgmt(fc)) {
if (len < 24) /* drop incorrect hdr len (mgmt) */
return NULL;
return hdr->addr3;
case IEEE80211_FTYPE_CTL:
if ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PSPOLL)
}

if (ieee80211_is_ctl(fc)) {
if(ieee80211_is_pspoll(fc))
return hdr->addr1;
else if ((fc & IEEE80211_FCTL_STYPE) ==
IEEE80211_STYPE_BACK_REQ) {

if (ieee80211_is_back_req(fc)) {
switch (type) {
case IEEE80211_IF_TYPE_STA:
return hdr->addr2;
case IEEE80211_IF_TYPE_AP:
case IEEE80211_IF_TYPE_VLAN:
return hdr->addr1;
default:
return NULL;
break; /* fall through to the return */
}
}
else
return NULL;
}

return NULL;
Expand Down

0 comments on commit b1b20ed

Please sign in to comment.