]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Interworking: Report STATUS:sp_type even if domain is not configured
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 29 Oct 2013 11:51:18 +0000 (13:51 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 29 Oct 2013 11:57:02 +0000 (13:57 +0200)
This allows sp_type={home,roaming,unknown} to be used to determine
network type with SIM-based credentials even if the domain name
parameter is not configured explicitly.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

wpa_supplicant/ctrl_iface.c
wpa_supplicant/interworking.c

index 809ae0c2ef43670b86a7e9572004ab2fe24c7654..801399f7e9b8a8f3631f19a4676d27c0743c7e52 100644 (file)
@@ -1569,10 +1569,8 @@ static int wpa_supplicant_ctrl_iface_status(struct wpa_supplicant *wpa_s,
 
                        if (wpa_s->current_ssid->parent_cred != cred)
                                continue;
-                       if (!cred->domain)
-                               continue;
 
-                       for (i = 0; i < cred->num_domain; i++) {
+                       for (i = 0; cred->domain && i < cred->num_domain; i++) {
                                ret = os_snprintf(pos, end - pos,
                                                  "home_sp=%s\n",
                                                  cred->domain[i]);
index 9e040a0db23c1814875292bd8a3407e0daf0139d..067b3bd43306375147c1e50d086d9ef4a8b2cdc9 100644 (file)
@@ -1550,6 +1550,7 @@ int interworking_home_sp_cred(struct wpa_supplicant *wpa_s,
                              struct wpabuf *domain_names)
 {
        size_t i;
+       int ret = -1;
 #ifdef INTERWORKING_3GPP
        char nai[100], *realm;
 
@@ -1580,11 +1581,13 @@ int interworking_home_sp_cred(struct wpa_supplicant *wpa_s,
                if (realm &&
                    domain_name_list_contains(domain_names, realm))
                        return 1;
+               if (realm)
+                       ret = 0;
        }
 #endif /* INTERWORKING_3GPP */
 
        if (domain_names == NULL || cred->domain == NULL)
-               return 0;
+               return ret;
 
        for (i = 0; i < cred->num_domain; i++) {
                wpa_printf(MSG_DEBUG, "Interworking: Search for match with "