UPnP: Removed shadowed variable
[wpasupplicant] / hostapd / config.c
index 5097f4d..c0381ea 100644 (file)
@@ -250,8 +250,6 @@ static struct hostapd_config * hostapd_config_defaults(void)
        conf->send_probe_response = 1;
        conf->bridge_packets = INTERNAL_BRIDGE_DO_NOT_CONTROL;
 
-       os_memcpy(conf->country, "US ", 3);
-
        for (i = 0; i < NUM_TX_QUEUES; i++)
                conf->tx_queue[i].aifs = -1; /* use hw default */
 
@@ -476,11 +474,6 @@ int hostapd_setup_wpa_psk(struct hostapd_bss_config *conf)
                wpa_hexdump(MSG_DEBUG, "PSK (from passphrase)",
                            ssid->wpa_psk->psk, PMK_LEN);
                ssid->wpa_psk->group = 1;
-
-               os_memset(ssid->wpa_passphrase, 0,
-                         os_strlen(ssid->wpa_passphrase));
-               os_free(ssid->wpa_passphrase);
-               ssid->wpa_passphrase = NULL;
        }
 
        if (ssid->wpa_psk_file) {
@@ -975,6 +968,12 @@ static int hostapd_config_check(struct hostapd_config *conf)
 {
        size_t i;
 
+       if (conf->ieee80211d && (!conf->country[0] || !conf->country[1])) {
+               wpa_printf(MSG_ERROR, "Cannot enable IEEE 802.11d without "
+                          "setting the country_code");
+               return -1;
+       }
+
        for (i = 0; i < conf->num_bss; i++) {
                if (hostapd_config_check_bss(&conf->bss[i], conf))
                        return -1;
@@ -2239,6 +2238,23 @@ struct hostapd_config * hostapd_config_read(const char *fname)
                                           line, pos);
                                errors++;
                        }
+               } else if (os_strcmp(buf, "upnp_iface") == 0) {
+                       bss->upnp_iface = os_strdup(pos);
+               } else if (os_strcmp(buf, "friendly_name") == 0) {
+                       os_free(bss->friendly_name);
+                       bss->friendly_name = os_strdup(pos);
+               } else if (os_strcmp(buf, "manufacturer_url") == 0) {
+                       os_free(bss->manufacturer_url);
+                       bss->manufacturer_url = os_strdup(pos);
+               } else if (os_strcmp(buf, "model_description") == 0) {
+                       os_free(bss->model_description);
+                       bss->model_description = os_strdup(pos);
+               } else if (os_strcmp(buf, "model_url") == 0) {
+                       os_free(bss->model_url);
+                       bss->model_url = os_strdup(pos);
+               } else if (os_strcmp(buf, "upc") == 0) {
+                       os_free(bss->upc);
+                       bss->upc = os_strdup(pos);
 #endif /* CONFIG_WPS */
                } else {
                        wpa_printf(MSG_ERROR, "Line %d: unknown configuration "
@@ -2446,6 +2462,12 @@ static void hostapd_config_free_bss(struct hostapd_bss_config *conf)
        os_free(conf->ap_pin);
        os_free(conf->extra_cred);
        os_free(conf->ap_settings);
+       os_free(conf->upnp_iface);
+       os_free(conf->friendly_name);
+       os_free(conf->manufacturer_url);
+       os_free(conf->model_description);
+       os_free(conf->model_url);
+       os_free(conf->upc);
 #endif /* CONFIG_WPS */
 }