]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
ieee802_11_mgmt: Handle frame info more consistently
authorJouni Malinen <j@w1.fi>
Wed, 7 Feb 2018 10:34:41 +0000 (12:34 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 7 Feb 2018 10:34:41 +0000 (12:34 +0200)
Check for the fi parameter to be non-NULL before trying to fetch the
ssi_signal information similarly to how the fi->freq was already
handled. While the meta information is supposed to be available, it
looks like there is at least one corner case where fi == NULL could be
used (Authentication frame reprocessing after RADIUS-based ACL).

Signed-off-by: Jouni Malinen <j@w1.fi>
src/ap/ieee802_11.c

index 38487a8835d6c2f40387bf7496fa3eea1996d283..8269b72b1e457146b4a12906348d0af10073b89d 100644 (file)
@@ -3829,6 +3829,7 @@ int ieee802_11_mgmt(struct hostapd_data *hapd, const u8 *buf, size_t len,
        u16 fc, stype;
        int ret = 0;
        unsigned int freq;
+       int ssi_signal = fi ? fi->ssi_signal : 0;
 
        if (len < 24)
                return 0;
@@ -3864,7 +3865,7 @@ int ieee802_11_mgmt(struct hostapd_data *hapd, const u8 *buf, size_t len,
 
 
        if (stype == WLAN_FC_STYPE_PROBE_REQ) {
-               handle_probe_req(hapd, mgmt, len, fi->ssi_signal);
+               handle_probe_req(hapd, mgmt, len, ssi_signal);
                return 1;
        }
 
@@ -3879,7 +3880,7 @@ int ieee802_11_mgmt(struct hostapd_data *hapd, const u8 *buf, size_t len,
        }
 
        if (hapd->iconf->track_sta_max_num)
-               sta_track_add(hapd->iface, mgmt->sa, fi->ssi_signal);
+               sta_track_add(hapd->iface, mgmt->sa, ssi_signal);
 
        switch (stype) {
        case WLAN_FC_STYPE_AUTH: