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

@@ -165,6 +165,8 @@ int main(int argc, FAR char *argv[])
if (handle)
{
struct dhcpc_state ds;
char inetaddr[INET_ADDRSTRLEN];
dhcpc_request(handle, &ds);
netlib_set_ipv4addr("eth0", &ds.ipaddr);
@@ -184,7 +186,7 @@ int main(int argc, FAR char *argv[])
}
dhcpc_close(handle);
printf("IP: %s\n", inet_ntoa(ds.ipaddr));
printf("IP: %s\n", inet_ntoa_r(ds.ipaddr, inetaddr, sizeof(inetaddr)));
}
#endif
#endif /* CONFIG_NSH_NETINIT */