aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers
diff options
context:
space:
mode:
authorSrinivas Dasari <dasaris@qti.qualcomm.com>2015-08-21 11:21:56 +0530
committerLinux Build Service Account <lnxbuild@localhost>2015-10-06 03:20:07 -0600
commitb387e23cf9da1974d7d26f374c636b74e6049b35 (patch)
tree871b5440e29e81a7a16807036465a0e6237e5514 /src/drivers
parentfa15349bd7eff9d772e70c1a1a45aa6171369549 (diff)
downloadandroid_external_wpa_supplicant_8-b387e23cf9da1974d7d26f374c636b74e6049b35.tar.gz
android_external_wpa_supplicant_8-b387e23cf9da1974d7d26f374c636b74e6049b35.tar.bz2
android_external_wpa_supplicant_8-b387e23cf9da1974d7d26f374c636b74e6049b35.zip
nl80211: Use beacon TSF if it is newer than Probe Response TSF
cfg80211 sends TSF information with the attribute NL80211_BSS_BEACON_TSF if the scan results include information from Beacon frame. Probe Response frame information is included in NL80211_BSS_TSF. If the device receives only Beacon frames, NL80211_BSS_TSF might not carry updated TSF, which results an older TSF being used in wpa_supplicant. Fetch both possible TSF values (if available) and choose the latest TSF for the BSS entry. CRs-Fixed: 889889 Git-repo: git://w1.fi/srv/git/hostap.git Git-commit: 75055a538b344425c91f0b70e99121f1e758fef5 Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> Change-Id: I14153490ca9891eed7688333ac561dbd029fd434
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/driver_nl80211_scan.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/drivers/driver_nl80211_scan.c b/src/drivers/driver_nl80211_scan.c
index 9cd3162f..f3d45e58 100644
--- a/src/drivers/driver_nl80211_scan.c
+++ b/src/drivers/driver_nl80211_scan.c
@@ -583,6 +583,11 @@ int bss_info_handler(struct nl_msg *msg, void *arg)
r->flags |= WPA_SCAN_LEVEL_INVALID | WPA_SCAN_QUAL_INVALID;
if (bss[NL80211_BSS_TSF])
r->tsf = nla_get_u64(bss[NL80211_BSS_TSF]);
+ if (bss[NL80211_BSS_BEACON_TSF]) {
+ u64 tsf = nla_get_u64(bss[NL80211_BSS_BEACON_TSF]);
+ if (tsf > r->tsf)
+ r->tsf = tsf;
+ }
if (bss[NL80211_BSS_SEEN_MS_AGO])
r->age = nla_get_u32(bss[NL80211_BSS_SEEN_MS_AGO]);
r->ie_len = ie_len;