Replace MAX_SSID_LEN with SSID_MAX_LEN
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 7 Apr 2015 09:44:39 +0000 (12:44 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 22 Apr 2015 08:44:18 +0000 (11:44 +0300)
This makes source code more consistent. The use within Android driver
interface is left as-is to avoid changes in the old PNO interface
definition.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
wpa_supplicant/config.c
wpa_supplicant/config.h
wpa_supplicant/config_ssid.h
wpa_supplicant/ctrl_iface.c
wpa_supplicant/dbus/dbus_new_handlers.c
wpa_supplicant/events.c
wpa_supplicant/wpa_supplicant.c

index cf16174..e1f4883 100644 (file)
@@ -1814,7 +1814,7 @@ static char * wpa_config_write_mesh_basic_rates(const struct parse_data *data,
  * functions.
  */
 static const struct parse_data ssid_fields[] = {
-       { STR_RANGE(ssid, 0, MAX_SSID_LEN) },
+       { STR_RANGE(ssid, 0, SSID_MAX_LEN) },
        { INT_RANGE(scan_ssid, 0, 1) },
        { FUNC(bssid) },
        { FUNC(bssid_blacklist) },
@@ -2956,7 +2956,7 @@ int wpa_config_set_cred(struct wpa_cred *cred, const char *var,
        if (os_strcmp(var, "excluded_ssid") == 0) {
                struct excluded_ssid *e;
 
-               if (len > MAX_SSID_LEN) {
+               if (len > SSID_MAX_LEN) {
                        wpa_printf(MSG_ERROR, "Line %d: invalid "
                                   "excluded_ssid length %d", line, (int) len);
                        os_free(val);
index 34b754e..16681fd 100644 (file)
@@ -37,6 +37,7 @@
 
 #include "config_ssid.h"
 #include "wps/wps.h"
+#include "common/ieee802_11_defs.h"
 #include "common/ieee802_11_common.h"
 
 
@@ -241,7 +242,7 @@ struct wpa_cred {
        char *phase2;
 
        struct excluded_ssid {
-               u8 ssid[MAX_SSID_LEN];
+               u8 ssid[SSID_MAX_LEN];
                size_t ssid_len;
        } *excluded_ssid;
        size_t num_excluded_ssid;
index 23a37cc..dbb5a47 100644 (file)
@@ -13,8 +13,6 @@
 #include "utils/list.h"
 #include "eap_peer/eap_config.h"
 
-#define MAX_SSID_LEN 32
-
 
 #define DEFAULT_EAP_WORKAROUND ((unsigned int) -1)
 #define DEFAULT_EAPOL_FLAGS (EAPOL_FLAG_REQUIRE_KEY_UNICAST | \
index 35eab27..a6aafee 100644 (file)
@@ -1729,7 +1729,7 @@ static int wpa_supplicant_ctrl_iface_status(struct wpa_supplicant *wpa_s,
                if (ssid) {
                        u8 *_ssid = ssid->ssid;
                        size_t ssid_len = ssid->ssid_len;
-                       u8 ssid_buf[MAX_SSID_LEN];
+                       u8 ssid_buf[SSID_MAX_LEN];
                        if (ssid_len == 0) {
                                int _res = wpa_drv_get_ssid(wpa_s, ssid_buf);
                                if (_res < 0)
index 66ee32f..d695d1b 100644 (file)
@@ -1034,10 +1034,10 @@ static int wpas_dbus_get_scan_ssids(DBusMessage *message, DBusMessageIter *var,
 
                dbus_message_iter_get_fixed_array(&sub_array_iter, &val, &len);
 
-               if (len > MAX_SSID_LEN) {
+               if (len > SSID_MAX_LEN) {
                        wpa_printf(MSG_DEBUG,
                                   "%s[dbus]: SSID too long (len=%d max_len=%d)",
-                                  __func__, len, MAX_SSID_LEN);
+                                  __func__, len, SSID_MAX_LEN);
                        *reply = wpas_dbus_error_invalid_args(
                                message, "Invalid SSID: too long");
                        return -1;
index a81cead..d086624 100644 (file)
@@ -158,7 +158,7 @@ static void wpa_supplicant_update_current_bss(struct wpa_supplicant *wpa_s)
 static int wpa_supplicant_select_config(struct wpa_supplicant *wpa_s)
 {
        struct wpa_ssid *ssid, *old_ssid;
-       u8 drv_ssid[MAX_SSID_LEN];
+       u8 drv_ssid[SSID_MAX_LEN];
        size_t drv_ssid_len;
        int res;
 
index 2ba9c38..b96fd8e 100644 (file)
@@ -2872,7 +2872,7 @@ int wpa_supplicant_set_debug_params(struct wpa_global *global, int debug_level,
 struct wpa_ssid * wpa_supplicant_get_ssid(struct wpa_supplicant *wpa_s)
 {
        struct wpa_ssid *entry;
-       u8 ssid[MAX_SSID_LEN];
+       u8 ssid[SSID_MAX_LEN];
        int res;
        size_t ssid_len;
        u8 bssid[ETH_ALEN];