From 732118eca386ddf1084c1db12e6754ea7ae8aaef Mon Sep 17 00:00:00 2001 From: Simon Wunderlich Date: Thu, 9 May 2013 20:21:41 +0300 Subject: [PATCH] Rename hostapd_parse_rates() to a more generic int list parser This can be used with other integer lists than just rates. Signed-hostap: Simon Wunderlich --- hostapd/config_file.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/hostapd/config_file.c b/hostapd/config_file.c index 3394f0013..231b0f9f7 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -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;