wifi: mac80211: ensure beacon is non-S1G prior to extracting the beacon timestamp...
[linux-2.6-block.git] / net / mac80211 / mlme.c
index 96b70006b7fc0b11b12f423fb74ec32a030d91af..db7128f6c901ec06bc9e84aa2f507c7bec0c3a2a 100644 (file)
@@ -6193,7 +6193,8 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_link_data *link,
                        link->u.mgd.dtim_period = elems->dtim_period;
                link->u.mgd.have_beacon = true;
                ifmgd->assoc_data->need_beacon = false;
-               if (ieee80211_hw_check(&local->hw, TIMING_BEACON_ONLY)) {
+               if (ieee80211_hw_check(&local->hw, TIMING_BEACON_ONLY) &&
+                   !ieee80211_is_s1g_beacon(hdr->frame_control)) {
                        link->conf->sync_tsf =
                                le64_to_cpu(mgmt->u.beacon.timestamp);
                        link->conf->sync_device_ts =