Replace HOSTAPD_MAX_SSID_LEN with SSID_MAX_LEN

This makes source code more consistent.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2015-04-07 12:41:20 +03:00 committed by Jouni Malinen
parent 6fb761c690
commit 81847c22ba
4 changed files with 8 additions and 9 deletions

View file

@ -1723,7 +1723,7 @@ static int hs20_parse_osu_ssid(struct hostapd_bss_config *bss,
char *str; char *str;
str = wpa_config_parse_string(pos, &slen); 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); wpa_printf(MSG_ERROR, "Line %d: Invalid SSID '%s'", line, pos);
os_free(str); os_free(str);
return -1; return -1;
@ -1970,7 +1970,7 @@ static int hostapd_config_fill(struct hostapd_config *conf,
line); line);
} else if (os_strcmp(buf, "ssid") == 0) { } else if (os_strcmp(buf, "ssid") == 0) {
bss->ssid.ssid_len = os_strlen(pos); 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) { bss->ssid.ssid_len < 1) {
wpa_printf(MSG_ERROR, "Line %d: invalid SSID '%s'", wpa_printf(MSG_ERROR, "Line %d: invalid SSID '%s'",
line, pos); line, pos);
@ -1981,7 +1981,7 @@ static int hostapd_config_fill(struct hostapd_config *conf,
} else if (os_strcmp(buf, "ssid2") == 0) { } else if (os_strcmp(buf, "ssid2") == 0) {
size_t slen; size_t slen;
char *str = wpa_config_parse_string(pos, &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'", wpa_printf(MSG_ERROR, "Line %d: invalid SSID '%s'",
line, pos); line, pos);
os_free(str); os_free(str);

View file

@ -12,6 +12,7 @@
#include "common/defs.h" #include "common/defs.h"
#include "ip_addr.h" #include "ip_addr.h"
#include "common/wpa_common.h" #include "common/wpa_common.h"
#include "common/ieee802_11_defs.h"
#include "common/ieee802_11_common.h" #include "common/ieee802_11_common.h"
#include "wps/wps.h" #include "wps/wps.h"
@ -57,8 +58,6 @@ struct hostapd_radius_servers;
struct ft_remote_r0kh; struct ft_remote_r0kh;
struct ft_remote_r1kh; struct ft_remote_r1kh;
#define HOSTAPD_MAX_SSID_LEN 32
#define NUM_WEP_KEYS 4 #define NUM_WEP_KEYS 4
struct hostapd_wep_keys { struct hostapd_wep_keys {
u8 idx; u8 idx;
@ -78,7 +77,7 @@ typedef enum hostap_security_policy {
} secpolicy; } secpolicy;
struct hostapd_ssid { struct hostapd_ssid {
u8 ssid[HOSTAPD_MAX_SSID_LEN]; u8 ssid[SSID_MAX_LEN];
size_t ssid_len; size_t ssid_len;
unsigned int ssid_set:1; unsigned int ssid_set:1;
unsigned int utf8_ssid:1; unsigned int utf8_ssid:1;
@ -511,7 +510,7 @@ struct hostapd_bss_config {
char file[256]; char file[256];
} *hs20_icons; } *hs20_icons;
size_t hs20_icons_count; size_t hs20_icons_count;
u8 osu_ssid[HOSTAPD_MAX_SSID_LEN]; u8 osu_ssid[SSID_MAX_LEN];
size_t osu_ssid_len; size_t osu_ssid_len;
struct hs20_osu_provider { struct hs20_osu_provider {
unsigned int friendly_name_count; unsigned int friendly_name_count;

View 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) static int hostapd_setup_bss(struct hostapd_data *hapd, int first)
{ {
struct hostapd_bss_config *conf = hapd->conf; 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; int ssid_len, set_ssid;
char force_ifname[IFNAMSIZ]; char force_ifname[IFNAMSIZ];
u8 if_addr[ETH_ALEN]; u8 if_addr[ETH_ALEN];

View 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"); wpa_printf(MSG_DEBUG, "WPS: Updating in-memory configuration");
bss->wps_state = 2; 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); os_memcpy(bss->ssid.ssid, cred->ssid, cred->ssid_len);
bss->ssid.ssid_len = cred->ssid_len; bss->ssid.ssid_len = cred->ssid_len;
bss->ssid.ssid_set = 1; bss->ssid.ssid_set = 1;