net: mqtt_sn: Use zsock_inet_ntop instead of inet_ntop
Use zsock_inet_ntop() instead of inet_ntop() to avoid dependency to the POSIX subsystem in the library. Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
parent
d745689fe7
commit
4d01228193
1 changed files with 4 additions and 4 deletions
|
@ -16,8 +16,6 @@
|
|||
#include <zephyr/net/socket.h>
|
||||
#include <zephyr/net/igmp.h>
|
||||
|
||||
#include <zephyr/posix/fcntl.h>
|
||||
|
||||
#include <zephyr/logging/log.h>
|
||||
LOG_MODULE_DECLARE(net_mqtt_sn, CONFIG_MQTT_SN_LOG_LEVEL);
|
||||
|
||||
|
@ -25,11 +23,13 @@ static char *get_ip_str(const struct sockaddr *sa, char *s, size_t maxlen)
|
|||
{
|
||||
switch (sa->sa_family) {
|
||||
case AF_INET:
|
||||
inet_ntop(AF_INET, &(((struct sockaddr_in *)sa)->sin_addr), s, maxlen);
|
||||
zsock_inet_ntop(AF_INET, &(((struct sockaddr_in *)sa)->sin_addr),
|
||||
s, maxlen);
|
||||
break;
|
||||
|
||||
case AF_INET6:
|
||||
inet_ntop(AF_INET6, &(((struct sockaddr_in6 *)sa)->sin6_addr), s, maxlen);
|
||||
zsock_inet_ntop(AF_INET6, &(((struct sockaddr_in6 *)sa)->sin6_addr),
|
||||
s, maxlen);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue