From c9d733391484316bbfdf740089c8a18f51961ad3 Mon Sep 17 00:00:00 2001 From: xiaosi Date: Mon, 23 Dec 2024 17:50:03 +0800 Subject: [PATCH 01/12] =?UTF-8?q?AI=E6=A3=80=E6=B5=8B=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xiaosi --- .../src/utils/common.c | 18 +++++++++++++++++ .../src/utils/common.h | 5 +++++ .../wpa_supplicant/ctrl_iface.c | 20 +++++++++---------- 3 files changed, 33 insertions(+), 10 deletions(-) mode change 100755 => 100644 wpa_supplicant-2.9_standard/src/utils/common.h diff --git a/wpa_supplicant-2.9_standard/src/utils/common.c b/wpa_supplicant-2.9_standard/src/utils/common.c index 167f508..dec2783 100644 --- a/wpa_supplicant-2.9_standard/src/utils/common.c +++ b/wpa_supplicant-2.9_standard/src/utils/common.c @@ -1343,3 +1343,21 @@ void forced_memzero(void *ptr, size_t len) if (len) forced_memzero_val = ((u8 *) ptr)[0]; } + +unsigned int AtoiToStrtol(const char *input) +{ + if(input[0] == '\0' || strlen(input) > MAX_INT32_LENGTH) { + return 0; + } + char *endPtr = NULL; + long result = 0; + result = strtol(input, &endPtr, NUMBER_BASE); + + if(endPtr == input || *endPtr != '\0'){ + return 0; + }else if((result == LONG_MIN || result == LONG_MAX) && (errno == ERANGE)){ + return 0; + }else { + return (unsigned int)result; + } +} diff --git a/wpa_supplicant-2.9_standard/src/utils/common.h b/wpa_supplicant-2.9_standard/src/utils/common.h old mode 100755 new mode 100644 index 7c9e72f..83d5c0d --- a/wpa_supplicant-2.9_standard/src/utils/common.h +++ b/wpa_supplicant-2.9_standard/src/utils/common.h @@ -24,6 +24,9 @@ #define CHANNEL_157 157 #define CHANNEL_161 161 +#define NUMBER_BASE 10 +#define MAX_INT32_LENGTH 11 + #if defined(__linux__) || defined(__GLIBC__) #include #include @@ -613,6 +616,8 @@ void forced_memzero(void *ptr, size_t len); const char *mac_to_str(const u8 *addr); +unsigned int AtoiToStrtol(const char *input); + /* * gcc 4.4 ends up generating strict-aliasing warnings about some very common * networking socket uses that do not really result in a real problem and diff --git a/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c b/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c index c29e799..fcb1181 100644 --- a/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c @@ -542,16 +542,16 @@ int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s, if (os_strcasecmp(cmd, "EAPOL::heldPeriod") == 0) { eapol_sm_configure(wpa_s->eapol, - atoi(value), -1, -1, -1); + AtoiToStrtol(value), -1, -1, -1); } else if (os_strcasecmp(cmd, "EAPOL::authPeriod") == 0) { eapol_sm_configure(wpa_s->eapol, - -1, atoi(value), -1, -1); + -1, AtoiToStrtol(value), -1, -1); } else if (os_strcasecmp(cmd, "EAPOL::startPeriod") == 0) { eapol_sm_configure(wpa_s->eapol, - -1, -1, atoi(value), -1); + -1, -1, AtoiToStrtol(value), -1); } else if (os_strcasecmp(cmd, "EAPOL::maxStart") == 0) { eapol_sm_configure(wpa_s->eapol, - -1, -1, -1, atoi(value)); + -1, -1, -1, AtoiToStrtol(value)); #ifdef CONFIG_TESTING_OPTIONS } else if (os_strcasecmp(cmd, "EAPOL::portControl") == 0) { if (os_strcmp(value, "Auto") == 0) @@ -567,7 +567,7 @@ int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s, #endif /* CONFIG_TESTING_OPTIONS */ } else if (os_strcasecmp(cmd, "dot11RSNAConfigPMKLifetime") == 0) { if (wpa_sm_set_param(wpa_s->wpa, RSNA_PMK_LIFETIME, - atoi(value))) { + AtoiToStrtol(value))) { ret = -1; } else { value[-1] = '='; @@ -576,7 +576,7 @@ int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s, } else if (os_strcasecmp(cmd, "dot11RSNAConfigPMKReauthThreshold") == 0) { if (wpa_sm_set_param(wpa_s->wpa, RSNA_PMK_REAUTH_THRESHOLD, - atoi(value))) { + AtoiToStrtol(value))) { ret = -1; } else { value[-1] = '='; @@ -584,14 +584,14 @@ int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s, } } else if (os_strcasecmp(cmd, "dot11RSNAConfigSATimeout") == 0) { if (wpa_sm_set_param(wpa_s->wpa, RSNA_SA_TIMEOUT, - atoi(value))) { + AtoiToStrtol(value))) { ret = -1; } else { value[-1] = '='; wpa_config_process_global(wpa_s->conf, cmd, -1); } } else if (os_strcasecmp(cmd, "wps_fragment_size") == 0) { - wpa_s->wps_fragment_size = atoi(value); + wpa_s->wps_fragment_size = AtoiToStrtol(value); #ifdef CONFIG_WPS_TESTING } else if (os_strcasecmp(cmd, "wps_version_number") == 0) { long int val; @@ -640,7 +640,7 @@ int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s, wpa_printf(MSG_DEBUG, "TDLS: tdls_testing=0x%x", tdls_testing); #endif /* CONFIG_TDLS_TESTING */ } else if (os_strcasecmp(cmd, "tdls_disabled") == 0) { - int disabled = atoi(value); + int disabled = AtoiToStrtol(value); wpa_printf(MSG_DEBUG, "TDLS: tdls_disabled=%d", disabled); if (disabled) { if (wpa_drv_tdls_oper(wpa_s, TDLS_DISABLE, NULL) < 0) @@ -652,7 +652,7 @@ int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s, } else if (os_strcasecmp(cmd, "pno") == 0) { ret = wpas_ctrl_pno(wpa_s, value); } else if (os_strcasecmp(cmd, "radio_disabled") == 0) { - int disabled = atoi(value); + int disabled = AtoiToStrtol(value); if (wpa_drv_radio_disable(wpa_s, disabled) < 0) ret = -1; else if (disabled) -- Gitee From 2614b3a65f895d3b915f91796b7c62324b43bc66 Mon Sep 17 00:00:00 2001 From: xiaosi Date: Tue, 24 Dec 2024 12:37:54 +0000 Subject: [PATCH 02/12] update wpa_supplicant-2.9_standard/src/utils/common.c. Signed-off-by: xiaosi --- .../src/utils/common.c | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/wpa_supplicant-2.9_standard/src/utils/common.c b/wpa_supplicant-2.9_standard/src/utils/common.c index dec2783..bd7ae51 100644 --- a/wpa_supplicant-2.9_standard/src/utils/common.c +++ b/wpa_supplicant-2.9_standard/src/utils/common.c @@ -1344,9 +1344,9 @@ void forced_memzero(void *ptr, size_t len) forced_memzero_val = ((u8 *) ptr)[0]; } -unsigned int AtoiToStrtol(const char *input) +unsigned int AtoiToStrtolUint(const char *input) { - if(input[0] == '\0' || strlen(input) > MAX_INT32_LENGTH) { + if(input == NULL || input[0] == '\0' || strlen(input) > MAX_UINT32_LENGTH) { return 0; } char *endPtr = NULL; @@ -1361,3 +1361,21 @@ unsigned int AtoiToStrtol(const char *input) return (unsigned int)result; } } + +int AtoiToStrtol(const char *input) +{ + if(intput == NULL || input[0] == '\0' || strlen(input) > MAX_INT32_LENGTH) { + return 0; + } + char *endPtr = NULL; + long result = 0; + result = strtol(input, &endPtr, NUMBER_BASE); + + if(endPtr == input || *endPtr != '\0'){ + return 0; + }else if((result == LONG_MIN || result == LONG_MAX) && (errno == ERANGE)){ + return 0; + }else { + return (int)result; + } +} \ No newline at end of file -- Gitee From b220a44ec980acbf211d9c026bc8147334a5b45e Mon Sep 17 00:00:00 2001 From: xiaosi Date: Tue, 24 Dec 2024 12:41:03 +0000 Subject: [PATCH 03/12] update wpa_supplicant-2.9_standard/src/utils/common.h. Signed-off-by: xiaosi --- wpa_supplicant-2.9_standard/src/utils/common.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wpa_supplicant-2.9_standard/src/utils/common.h b/wpa_supplicant-2.9_standard/src/utils/common.h index 83d5c0d..0d8ac7d 100644 --- a/wpa_supplicant-2.9_standard/src/utils/common.h +++ b/wpa_supplicant-2.9_standard/src/utils/common.h @@ -25,6 +25,7 @@ #define CHANNEL_161 161 #define NUMBER_BASE 10 +#define MAX_UINT32_LENGTH 10 #define MAX_INT32_LENGTH 11 #if defined(__linux__) || defined(__GLIBC__) @@ -616,7 +617,8 @@ void forced_memzero(void *ptr, size_t len); const char *mac_to_str(const u8 *addr); -unsigned int AtoiToStrtol(const char *input); +unsigned int AtoiToStrtolUint(const char *input); +int AtoiToStrtol(const char *input); /* * gcc 4.4 ends up generating strict-aliasing warnings about some very common -- Gitee From a1eb3f4ecae26a985bde9b7569da52c2764ee2b0 Mon Sep 17 00:00:00 2001 From: xiaosi Date: Tue, 24 Dec 2024 12:51:51 +0000 Subject: [PATCH 04/12] update wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c. Signed-off-by: xiaosi --- wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c b/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c index fcb1181..80042dd 100644 --- a/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c @@ -567,7 +567,7 @@ int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s, #endif /* CONFIG_TESTING_OPTIONS */ } else if (os_strcasecmp(cmd, "dot11RSNAConfigPMKLifetime") == 0) { if (wpa_sm_set_param(wpa_s->wpa, RSNA_PMK_LIFETIME, - AtoiToStrtol(value))) { + AtoiToStrtolUint(value))) { ret = -1; } else { value[-1] = '='; @@ -576,7 +576,7 @@ int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s, } else if (os_strcasecmp(cmd, "dot11RSNAConfigPMKReauthThreshold") == 0) { if (wpa_sm_set_param(wpa_s->wpa, RSNA_PMK_REAUTH_THRESHOLD, - AtoiToStrtol(value))) { + AtoiToStrtolUint(value))) { ret = -1; } else { value[-1] = '='; @@ -584,7 +584,7 @@ int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s, } } else if (os_strcasecmp(cmd, "dot11RSNAConfigSATimeout") == 0) { if (wpa_sm_set_param(wpa_s->wpa, RSNA_SA_TIMEOUT, - AtoiToStrtol(value))) { + AtoiToStrtolUint(value))) { ret = -1; } else { value[-1] = '='; -- Gitee From 06b9337070b6e289352fbc2451e237674c5214f6 Mon Sep 17 00:00:00 2001 From: xiaosi Date: Tue, 24 Dec 2024 13:28:38 +0000 Subject: [PATCH 05/12] update wpa_supplicant-2.9_standard/src/utils/common.c. Signed-off-by: xiaosi --- wpa_supplicant-2.9_standard/src/utils/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wpa_supplicant-2.9_standard/src/utils/common.c b/wpa_supplicant-2.9_standard/src/utils/common.c index bd7ae51..e1dc02b 100644 --- a/wpa_supplicant-2.9_standard/src/utils/common.c +++ b/wpa_supplicant-2.9_standard/src/utils/common.c @@ -1350,7 +1350,7 @@ unsigned int AtoiToStrtolUint(const char *input) return 0; } char *endPtr = NULL; - long result = 0; + unsigned long result = 0; result = strtol(input, &endPtr, NUMBER_BASE); if(endPtr == input || *endPtr != '\0'){ -- Gitee From 25d6ca85a4c5eafbd7d67369316f5e0cfbecfc01 Mon Sep 17 00:00:00 2001 From: xiaosi Date: Wed, 25 Dec 2024 01:16:39 +0000 Subject: [PATCH 06/12] update wpa_supplicant-2.9_standard/src/utils/common.c. Signed-off-by: xiaosi --- wpa_supplicant-2.9_standard/src/utils/common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wpa_supplicant-2.9_standard/src/utils/common.c b/wpa_supplicant-2.9_standard/src/utils/common.c index e1dc02b..f0593bf 100644 --- a/wpa_supplicant-2.9_standard/src/utils/common.c +++ b/wpa_supplicant-2.9_standard/src/utils/common.c @@ -1355,7 +1355,7 @@ unsigned int AtoiToStrtolUint(const char *input) if(endPtr == input || *endPtr != '\0'){ return 0; - }else if((result == LONG_MIN || result == LONG_MAX) && (errno == ERANGE)){ + }else if((result == ULONG_MAX) && (errno == ERANGE)){ return 0; }else { return (unsigned int)result; @@ -1364,7 +1364,7 @@ unsigned int AtoiToStrtolUint(const char *input) int AtoiToStrtol(const char *input) { - if(intput == NULL || input[0] == '\0' || strlen(input) > MAX_INT32_LENGTH) { + if(input == NULL || input[0] == '\0' || strlen(input) > MAX_INT32_LENGTH) { return 0; } char *endPtr = NULL; -- Gitee From b85281dc450db04c9784522560c8aa9a2cea2322 Mon Sep 17 00:00:00 2001 From: xiaosi Date: Thu, 26 Dec 2024 02:26:00 +0000 Subject: [PATCH 07/12] update wpa_supplicant-2.9_standard/src/utils/common.c. Signed-off-by: xiaosi --- wpa_supplicant-2.9_standard/src/utils/common.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/wpa_supplicant-2.9_standard/src/utils/common.c b/wpa_supplicant-2.9_standard/src/utils/common.c index f0593bf..34619db 100644 --- a/wpa_supplicant-2.9_standard/src/utils/common.c +++ b/wpa_supplicant-2.9_standard/src/utils/common.c @@ -1353,11 +1353,11 @@ unsigned int AtoiToStrtolUint(const char *input) unsigned long result = 0; result = strtol(input, &endPtr, NUMBER_BASE); - if(endPtr == input || *endPtr != '\0'){ + if(endPtr == input || *endPtr != '\0') { return 0; - }else if((result == ULONG_MAX) && (errno == ERANGE)){ + } else if(errno == ERANGE) { return 0; - }else { + } else { return (unsigned int)result; } } @@ -1371,11 +1371,11 @@ int AtoiToStrtol(const char *input) long result = 0; result = strtol(input, &endPtr, NUMBER_BASE); - if(endPtr == input || *endPtr != '\0'){ + if(endPtr == input || *endPtr != '\0') { return 0; - }else if((result == LONG_MIN || result == LONG_MAX) && (errno == ERANGE)){ + } else if(errno == ERANGE) { return 0; - }else { + } else { return (int)result; } } \ No newline at end of file -- Gitee From 9e1e4649302511dcc773b1b18e5ecc89791e03e5 Mon Sep 17 00:00:00 2001 From: xiaosi Date: Thu, 26 Dec 2024 02:29:03 +0000 Subject: [PATCH 08/12] update wpa_supplicant-2.9_standard/src/utils/common.h. Signed-off-by: xiaosi --- wpa_supplicant-2.9_standard/src/utils/common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wpa_supplicant-2.9_standard/src/utils/common.h b/wpa_supplicant-2.9_standard/src/utils/common.h index 0d8ac7d..c794548 100644 --- a/wpa_supplicant-2.9_standard/src/utils/common.h +++ b/wpa_supplicant-2.9_standard/src/utils/common.h @@ -25,8 +25,8 @@ #define CHANNEL_161 161 #define NUMBER_BASE 10 -#define MAX_UINT32_LENGTH 10 -#define MAX_INT32_LENGTH 11 +#define MAX_UINT32_LENGTH 10 // 0 ~ 4294967295 +#define MAX_INT32_LENGTH 11 // -2147483648 ~ 2147483647 #if defined(__linux__) || defined(__GLIBC__) #include -- Gitee From c83acb5a0e3922b704c019a31968e496e7f19a6e Mon Sep 17 00:00:00 2001 From: xiaosi Date: Thu, 26 Dec 2024 02:32:52 +0000 Subject: [PATCH 09/12] update wpa_supplicant-2.9_standard/src/utils/common.h. Signed-off-by: xiaosi --- wpa_supplicant-2.9_standard/src/utils/common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wpa_supplicant-2.9_standard/src/utils/common.h b/wpa_supplicant-2.9_standard/src/utils/common.h index c794548..d9aa598 100644 --- a/wpa_supplicant-2.9_standard/src/utils/common.h +++ b/wpa_supplicant-2.9_standard/src/utils/common.h @@ -25,8 +25,8 @@ #define CHANNEL_161 161 #define NUMBER_BASE 10 -#define MAX_UINT32_LENGTH 10 // 0 ~ 4294967295 -#define MAX_INT32_LENGTH 11 // -2147483648 ~ 2147483647 +#define MAX_UINT32_LENGTH 10 /* 0 ~ 4294967295 */ +#define MAX_INT32_LENGTH 11 /* -2147483648 ~ 2147483647 */ #if defined(__linux__) || defined(__GLIBC__) #include -- Gitee From aff1f7ab325a77a7155084b19c5bbbbf8e2b67b8 Mon Sep 17 00:00:00 2001 From: xiaosi Date: Fri, 27 Dec 2024 03:12:19 +0000 Subject: [PATCH 10/12] update wpa_supplicant-2.9_standard/src/utils/common.c. Signed-off-by: xiaosi --- wpa_supplicant-2.9_standard/src/utils/common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wpa_supplicant-2.9_standard/src/utils/common.c b/wpa_supplicant-2.9_standard/src/utils/common.c index 34619db..cc455a7 100644 --- a/wpa_supplicant-2.9_standard/src/utils/common.c +++ b/wpa_supplicant-2.9_standard/src/utils/common.c @@ -1344,7 +1344,7 @@ void forced_memzero(void *ptr, size_t len) forced_memzero_val = ((u8 *) ptr)[0]; } -unsigned int AtoiToStrtolUint(const char *input) +unsigned int StrtoUint(const char *input) { if(input == NULL || input[0] == '\0' || strlen(input) > MAX_UINT32_LENGTH) { return 0; @@ -1362,7 +1362,7 @@ unsigned int AtoiToStrtolUint(const char *input) } } -int AtoiToStrtol(const char *input) +int StrtoInt(const char *input) { if(input == NULL || input[0] == '\0' || strlen(input) > MAX_INT32_LENGTH) { return 0; -- Gitee From d0fe4f08e83ca8a2485a0ecd2f5844ac42d02479 Mon Sep 17 00:00:00 2001 From: xiaosi Date: Fri, 27 Dec 2024 03:13:38 +0000 Subject: [PATCH 11/12] update wpa_supplicant-2.9_standard/src/utils/common.h. Signed-off-by: xiaosi --- wpa_supplicant-2.9_standard/src/utils/common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wpa_supplicant-2.9_standard/src/utils/common.h b/wpa_supplicant-2.9_standard/src/utils/common.h index d9aa598..75d9ee0 100644 --- a/wpa_supplicant-2.9_standard/src/utils/common.h +++ b/wpa_supplicant-2.9_standard/src/utils/common.h @@ -617,8 +617,8 @@ void forced_memzero(void *ptr, size_t len); const char *mac_to_str(const u8 *addr); -unsigned int AtoiToStrtolUint(const char *input); -int AtoiToStrtol(const char *input); +unsigned int StrtoUint(const char *input); +int StrtoInt(const char *input); /* * gcc 4.4 ends up generating strict-aliasing warnings about some very common -- Gitee From 04383175d9042eac6b929ae0a4d2ecbfcd62b8cc Mon Sep 17 00:00:00 2001 From: xiaosi Date: Fri, 27 Dec 2024 03:20:13 +0000 Subject: [PATCH 12/12] update wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c. Signed-off-by: xiaosi --- .../wpa_supplicant/ctrl_iface.c | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c b/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c index 80042dd..776c3d4 100644 --- a/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c @@ -542,16 +542,16 @@ int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s, if (os_strcasecmp(cmd, "EAPOL::heldPeriod") == 0) { eapol_sm_configure(wpa_s->eapol, - AtoiToStrtol(value), -1, -1, -1); + StrtoInt(value), -1, -1, -1); } else if (os_strcasecmp(cmd, "EAPOL::authPeriod") == 0) { eapol_sm_configure(wpa_s->eapol, - -1, AtoiToStrtol(value), -1, -1); + -1, StrtoInt(value), -1, -1); } else if (os_strcasecmp(cmd, "EAPOL::startPeriod") == 0) { eapol_sm_configure(wpa_s->eapol, - -1, -1, AtoiToStrtol(value), -1); + -1, -1, StrtoInt(value), -1); } else if (os_strcasecmp(cmd, "EAPOL::maxStart") == 0) { eapol_sm_configure(wpa_s->eapol, - -1, -1, -1, AtoiToStrtol(value)); + -1, -1, -1, StrtoInt(value)); #ifdef CONFIG_TESTING_OPTIONS } else if (os_strcasecmp(cmd, "EAPOL::portControl") == 0) { if (os_strcmp(value, "Auto") == 0) @@ -567,7 +567,7 @@ int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s, #endif /* CONFIG_TESTING_OPTIONS */ } else if (os_strcasecmp(cmd, "dot11RSNAConfigPMKLifetime") == 0) { if (wpa_sm_set_param(wpa_s->wpa, RSNA_PMK_LIFETIME, - AtoiToStrtolUint(value))) { + StrtoUint(value))) { ret = -1; } else { value[-1] = '='; @@ -576,7 +576,7 @@ int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s, } else if (os_strcasecmp(cmd, "dot11RSNAConfigPMKReauthThreshold") == 0) { if (wpa_sm_set_param(wpa_s->wpa, RSNA_PMK_REAUTH_THRESHOLD, - AtoiToStrtolUint(value))) { + StrtoUint(value))) { ret = -1; } else { value[-1] = '='; @@ -584,14 +584,14 @@ int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s, } } else if (os_strcasecmp(cmd, "dot11RSNAConfigSATimeout") == 0) { if (wpa_sm_set_param(wpa_s->wpa, RSNA_SA_TIMEOUT, - AtoiToStrtolUint(value))) { + StrtoUint(value))) { ret = -1; } else { value[-1] = '='; wpa_config_process_global(wpa_s->conf, cmd, -1); } } else if (os_strcasecmp(cmd, "wps_fragment_size") == 0) { - wpa_s->wps_fragment_size = AtoiToStrtol(value); + wpa_s->wps_fragment_size = StrtoInt(value); #ifdef CONFIG_WPS_TESTING } else if (os_strcasecmp(cmd, "wps_version_number") == 0) { long int val; @@ -640,7 +640,7 @@ int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s, wpa_printf(MSG_DEBUG, "TDLS: tdls_testing=0x%x", tdls_testing); #endif /* CONFIG_TDLS_TESTING */ } else if (os_strcasecmp(cmd, "tdls_disabled") == 0) { - int disabled = AtoiToStrtol(value); + int disabled = StrtoInt(value); wpa_printf(MSG_DEBUG, "TDLS: tdls_disabled=%d", disabled); if (disabled) { if (wpa_drv_tdls_oper(wpa_s, TDLS_DISABLE, NULL) < 0) @@ -652,7 +652,7 @@ int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s, } else if (os_strcasecmp(cmd, "pno") == 0) { ret = wpas_ctrl_pno(wpa_s, value); } else if (os_strcasecmp(cmd, "radio_disabled") == 0) { - int disabled = AtoiToStrtol(value); + int disabled = StrtoInt(value); if (wpa_drv_radio_disable(wpa_s, disabled) < 0) ret = -1; else if (disabled) -- Gitee