diff --git a/net/sock.c b/net/sock.c index ab5dbec..6b8feee 100644 --- a/net/sock.c +++ b/net/sock.c @@ -665,7 +665,7 @@ int sock_accept(sock_t serversock, char *ip, int len) ret = accept(serversock, (struct sockaddr *)&sin, &slen); if (ret >= 0 && ip != NULL) { - // inet_ntoa is not reentrant, we should protect this + /* inet_ntoa is not reentrant, we should protect this */ strncpy(ip, inet_ntoa(sin.sin_addr), len); sock_set_nolinger(ret); sock_set_keepalive(ret); diff --git a/net/sock.h b/net/sock.h index 42cf278..fa0d261 100644 --- a/net/sock.h +++ b/net/sock.h @@ -42,6 +42,10 @@ struct iovec #endif #endif +#ifdef HAVE_INET_PTON +#define inet_aton(a,b) inet_pton(AF_INET, (a), (b)) +#endif + typedef int sock_t; /* The following values are based on unix avoiding errno value clashes */