Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213969
b: refs/heads/master
c: 4083858
h: refs/heads/master
i:
  213967: 49f6034
v: v3
  • Loading branch information
Dan Williams authored and John W. Linville committed Aug 16, 2010
1 parent 880bdc4 commit 3afca7a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 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: 1e51b2ff0a33797476932a68d36136921e4e1b05
refs/heads/master: 4083858c8b309068024ba43672d831999d69ba3f
24 changes: 20 additions & 4 deletions trunk/drivers/net/wireless/libertas/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,20 +524,31 @@ static int lbs_ret_scan(struct lbs_private *priv, unsigned long dummy,

pos = scanresp->bssdesc_and_tlvbuffer;

lbs_deb_hex(LBS_DEB_SCAN, "SCAN_RSP", scanresp->bssdesc_and_tlvbuffer,
scanresp->bssdescriptsize);

tsfdesc = pos + bsssize;
tsfsize = 4 + 8 * scanresp->nr_sets;
lbs_deb_hex(LBS_DEB_SCAN, "SCAN_TSF", (u8 *) tsfdesc, tsfsize);

/* Validity check: we expect a Marvell-Local TLV */
i = get_unaligned_le16(tsfdesc);
tsfdesc += 2;
if (i != TLV_TYPE_TSFTIMESTAMP)
if (i != TLV_TYPE_TSFTIMESTAMP) {
lbs_deb_scan("scan response: invalid TSF Timestamp %d\n", i);
goto done;
}

/* Validity check: the TLV holds TSF values with 8 bytes each, so
* the size in the TLV must match the nr_sets value */
i = get_unaligned_le16(tsfdesc);
tsfdesc += 2;
if (i / 8 != scanresp->nr_sets)
if (i / 8 != scanresp->nr_sets) {
lbs_deb_scan("scan response: invalid number of TSF timestamp "
"sets (expected %d got %d)\n", scanresp->nr_sets,
i / 8);
goto done;
}

for (i = 0; i < scanresp->nr_sets; i++) {
const u8 *bssid;
Expand Down Expand Up @@ -579,8 +590,11 @@ static int lbs_ret_scan(struct lbs_private *priv, unsigned long dummy,
id = *pos++;
elen = *pos++;
left -= 2;
if (elen > left || elen == 0)
if (elen > left || elen == 0) {
lbs_deb_scan("scan response: invalid IE fmt\n");
goto done;
}

if (id == WLAN_EID_DS_PARAMS)
chan_no = *pos;
if (id == WLAN_EID_SSID) {
Expand Down Expand Up @@ -611,7 +625,9 @@ static int lbs_ret_scan(struct lbs_private *priv, unsigned long dummy,
capa, intvl, ie, ielen,
LBS_SCAN_RSSI_TO_MBM(rssi),
GFP_KERNEL);
}
} else
lbs_deb_scan("scan response: missing BSS channel IE\n");

tsfdesc += 8;
}
ret = 0;
Expand Down

0 comments on commit 3afca7a

Please sign in to comment.