]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Rename hostapd_parse_rates() to a more generic int list parser
authorSimon Wunderlich <siwu@hrz.tu-chemnitz.de>
Thu, 9 May 2013 17:21:41 +0000 (20:21 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 9 May 2013 17:27:47 +0000 (20:27 +0300)
This can be used with other integer lists than just rates.

Signed-hostap: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>

hostapd/config_file.c

index 3394f0013a55b53b6b9b9ab049f7dc57ae1c218e..231b0f9f73677375077865da4ac468ac438df495 100644 (file)
@@ -710,14 +710,14 @@ static int hostapd_config_read_wep(struct hostapd_wep_keys *wep, int keyidx,
 }
 
 
-static int hostapd_parse_rates(int **rate_list, char *val)
+static int hostapd_parse_intlist(int **int_list, char *val)
 {
        int *list;
        int count;
        char *pos, *end;
 
-       os_free(*rate_list);
-       *rate_list = NULL;
+       os_free(*int_list);
+       *int_list = NULL;
 
        pos = val;
        count = 0;
@@ -744,7 +744,7 @@ static int hostapd_parse_rates(int **rate_list, char *val)
        }
        list[count] = -1;
 
-       *rate_list = list;
+       *int_list = list;
        return 0;
 }
 
@@ -2356,13 +2356,14 @@ static int hostapd_config_fill(struct hostapd_config *conf,
                        } else
                                conf->send_probe_response = val;
                } else if (os_strcmp(buf, "supported_rates") == 0) {
-                       if (hostapd_parse_rates(&conf->supported_rates, pos)) {
+                       if (hostapd_parse_intlist(&conf->supported_rates, pos))
+                       {
                                wpa_printf(MSG_ERROR, "Line %d: invalid rate "
                                           "list", line);
                                errors++;
                        }
                } else if (os_strcmp(buf, "basic_rates") == 0) {
-                       if (hostapd_parse_rates(&conf->basic_rates, pos)) {
+                       if (hostapd_parse_intlist(&conf->basic_rates, pos)) {
                                wpa_printf(MSG_ERROR, "Line %d: invalid rate "
                                           "list", line);
                                errors++;
@@ -2934,7 +2935,7 @@ static int hostapd_config_fill(struct hostapd_config *conf,
                } else if (os_strcmp(buf, "sae_anti_clogging_threshold") == 0) {
                        bss->sae_anti_clogging_threshold = atoi(pos);
                } else if (os_strcmp(buf, "sae_groups") == 0) {
-                       if (hostapd_parse_rates(&bss->sae_groups, pos)) {
+                       if (hostapd_parse_intlist(&bss->sae_groups, pos)) {
                                wpa_printf(MSG_ERROR, "Line %d: Invalid "
                                           "sae_groups value '%s'", line, pos);
                                return 1;