Use thread-safe ntoa functions

NXStyle fixes

Apply suggestions from code review

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

API fixes and NXStyle fixes

Apply suggestions from code review

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

Use thread-safe ntoa functions

NXStyle fixes

Apply suggestions from code review

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

API fixes and NXStyle fixes

Apply suggestions from code review

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
This commit is contained in:
Peter van der Perk
2022-08-01 11:18:52 +02:00
committed by Xiang Xiao
parent c5102fe504
commit dcd60a2abe
11 changed files with 192 additions and 114 deletions

View File

@@ -267,6 +267,7 @@ static int wapi_show_cmd(int sock, int argc, FAR char **argv)
int sense;
int chan;
int ret;
char inetaddr[INET_ADDRSTRLEN];
printf("%s Configuration:\n", ifname);
@@ -281,7 +282,8 @@ static int wapi_show_cmd(int sock, int argc, FAR char **argv)
}
else
{
printf(" IP: %s\n", inet_ntoa(addr));
printf(" IP: %s\n", inet_ntoa_r(addr, inetaddr,
sizeof(inetaddr)));
}
/* Get netmask */
@@ -294,7 +296,8 @@ static int wapi_show_cmd(int sock, int argc, FAR char **argv)
}
else
{
printf(" NetMask: %s\n", inet_ntoa(addr));
printf(" NetMask: %s\n", inet_ntoa_r(addr, inetaddr,
sizeof(inetaddr)));
}
/* Get frequency */
@@ -913,6 +916,7 @@ static int wapi_reconnect_cmd(int sock, int argc, FAR char **argv)
static int wapi_save_config_cmd(int sock, int argc, FAR char **argv)
{
char essid[WAPI_ESSID_MAX_SIZE + 1];
char bssid[20];
enum wapi_essid_flag_e essid_flag;
struct wpa_wconfig_s conf;
struct ether_addr ap;
@@ -958,7 +962,7 @@ static int wapi_save_config_cmd(int sock, int argc, FAR char **argv)
return ret;
}
conf.bssid = ether_ntoa(&ap);
conf.bssid = ether_ntoa_r(&ap, bssid);
memset(psk, 0, sizeof(psk));
ret = wpa_driver_wext_get_key_ext(sock,