From e8d91f15a176abef1b6b4c6baa20bf7632c67c0e Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Wed, 3 Jul 2019 10:32:26 -0700 Subject: [PATCH] hotspot: allow HESSID without NAIRealmNames The original idea was to allow the provisioning file to include HESSID without the NAIRealmNames. Configuring this way would allow for ANQP to be skipped completely, assuming the AP advertises its HESSID. The way the code was written still required NAIRealmNames to be provided in the provisioning file. --- src/hotspot.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hotspot.c b/src/hotspot.c index 3f53d318..d4c99d5a 100644 --- a/src/hotspot.c +++ b/src/hotspot.c @@ -70,7 +70,7 @@ static struct hs20_config *hs20_config_new(struct l_settings *settings, { struct hs20_config *config; char *str; - char **nai_realms; + char **nai_realms = NULL; config = l_new(struct hs20_config, 1); @@ -79,9 +79,10 @@ static struct hs20_config *hs20_config_new(struct l_settings *settings, if (str) { util_string_to_address(str, config->hessid); l_free(str); + goto done; } - /* NAI realms are required */ + /* NAI realms are required if HESSID is not included */ nai_realms = l_settings_get_string_list(settings, "Hotspot", "NAIRealmNames", ','); if (!nai_realms) { @@ -89,6 +90,7 @@ static struct hs20_config *hs20_config_new(struct l_settings *settings, return NULL; } +done: config->nai_realms = nai_realms; config->filename = l_strdup(filename);