]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Replace HOSTAPD_MAX_SSID_LEN with SSID_MAX_LEN
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 7 Apr 2015 09:41:20 +0000 (12:41 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 22 Apr 2015 08:44:18 +0000 (11:44 +0300)
This makes source code more consistent.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
hostapd/config_file.c
src/ap/ap_config.h
src/ap/hostapd.c
src/ap/wps_hostapd.c

index f4cccf562e1a35fc92a0fd2b39074a56ee55faba..11866445bd4b78f1734e2917a9bdbddcedde61be 100644 (file)
@@ -1723,7 +1723,7 @@ static int hs20_parse_osu_ssid(struct hostapd_bss_config *bss,
        char *str;
 
        str = wpa_config_parse_string(pos, &slen);
-       if (str == NULL || slen < 1 || slen > HOSTAPD_MAX_SSID_LEN) {
+       if (str == NULL || slen < 1 || slen > SSID_MAX_LEN) {
                wpa_printf(MSG_ERROR, "Line %d: Invalid SSID '%s'", line, pos);
                os_free(str);
                return -1;
@@ -1970,7 +1970,7 @@ static int hostapd_config_fill(struct hostapd_config *conf,
                           line);
        } else if (os_strcmp(buf, "ssid") == 0) {
                bss->ssid.ssid_len = os_strlen(pos);
-               if (bss->ssid.ssid_len > HOSTAPD_MAX_SSID_LEN ||
+               if (bss->ssid.ssid_len > SSID_MAX_LEN ||
                    bss->ssid.ssid_len < 1) {
                        wpa_printf(MSG_ERROR, "Line %d: invalid SSID '%s'",
                                   line, pos);
@@ -1981,7 +1981,7 @@ static int hostapd_config_fill(struct hostapd_config *conf,
        } else if (os_strcmp(buf, "ssid2") == 0) {
                size_t slen;
                char *str = wpa_config_parse_string(pos, &slen);
-               if (str == NULL || slen < 1 || slen > HOSTAPD_MAX_SSID_LEN) {
+               if (str == NULL || slen < 1 || slen > SSID_MAX_LEN) {
                        wpa_printf(MSG_ERROR, "Line %d: invalid SSID '%s'",
                                   line, pos);
                        os_free(str);
index 00d52408a3444c4087bf3a570e95c7f0a41aeb9c..7b4a7eaa2606f9540bead87d032e708f1ad63e1c 100644 (file)
@@ -12,6 +12,7 @@
 #include "common/defs.h"
 #include "ip_addr.h"
 #include "common/wpa_common.h"
+#include "common/ieee802_11_defs.h"
 #include "common/ieee802_11_common.h"
 #include "wps/wps.h"
 
@@ -57,8 +58,6 @@ struct hostapd_radius_servers;
 struct ft_remote_r0kh;
 struct ft_remote_r1kh;
 
-#define HOSTAPD_MAX_SSID_LEN 32
-
 #define NUM_WEP_KEYS 4
 struct hostapd_wep_keys {
        u8 idx;
@@ -78,7 +77,7 @@ typedef enum hostap_security_policy {
 } secpolicy;
 
 struct hostapd_ssid {
-       u8 ssid[HOSTAPD_MAX_SSID_LEN];
+       u8 ssid[SSID_MAX_LEN];
        size_t ssid_len;
        unsigned int ssid_set:1;
        unsigned int utf8_ssid:1;
@@ -511,7 +510,7 @@ struct hostapd_bss_config {
                char file[256];
        } *hs20_icons;
        size_t hs20_icons_count;
-       u8 osu_ssid[HOSTAPD_MAX_SSID_LEN];
+       u8 osu_ssid[SSID_MAX_LEN];
        size_t osu_ssid_len;
        struct hs20_osu_provider {
                unsigned int friendly_name_count;
index 6cdb6d37ffe015208aedb9f84d4f19c6c62de5a3..5abe5edd894d5b236d59cd6df108f066f0e54728 100644 (file)
@@ -862,7 +862,7 @@ hostapd_das_disconnect(void *ctx, struct radius_das_attrs *attr)
 static int hostapd_setup_bss(struct hostapd_data *hapd, int first)
 {
        struct hostapd_bss_config *conf = hapd->conf;
-       u8 ssid[HOSTAPD_MAX_SSID_LEN + 1];
+       u8 ssid[SSID_MAX_LEN + 1];
        int ssid_len, set_ssid;
        char force_ifname[IFNAMSIZ];
        u8 if_addr[ETH_ALEN];
index 7e74829138bf71f24b1065915956906780128aa7..68eaeca1cce71b2e50b7d8fcdfd1e53dd1d177de 100644 (file)
@@ -324,7 +324,7 @@ static int hapd_wps_reconfig_in_memory(struct hostapd_data *hapd,
        wpa_printf(MSG_DEBUG, "WPS: Updating in-memory configuration");
 
        bss->wps_state = 2;
-       if (cred->ssid_len <= HOSTAPD_MAX_SSID_LEN) {
+       if (cred->ssid_len <= SSID_MAX_LEN) {
                os_memcpy(bss->ssid.ssid, cred->ssid, cred->ssid_len);
                bss->ssid.ssid_len = cred->ssid_len;
                bss->ssid.ssid_set = 1;