Skip to content

Commit e5b6f43

Browse files
committed
get rid of inet_addr usage
1 parent 9ba3c36 commit e5b6f43

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

main/fastcgi.c

+4
Original file line numberDiff line numberDiff line change
@@ -688,8 +688,12 @@ int fcgi_listen(const char *path, int backlog)
688688
if (!*host || !strncmp(host, "*", sizeof("*")-1)) {
689689
sa.sa_inet.sin_addr.s_addr = htonl(INADDR_ANY);
690690
} else {
691+
#ifdef HAVE_INET_PTON
692+
if (!inet_pton(AF_INET, host, &sa.sa_inet.sin_addr)) {
693+
#else
691694
sa.sa_inet.sin_addr.s_addr = inet_addr(host);
692695
if (sa.sa_inet.sin_addr.s_addr == INADDR_NONE) {
696+
#endif
693697
struct hostent *hep;
694698

695699
if(strlen(host) > MAXFQDNLEN) {

sapi/litespeed/lsapilib.c

+4
Original file line numberDiff line numberDiff line change
@@ -2672,8 +2672,12 @@ int LSAPI_ParseSockAddr( const char * pBind, struct sockaddr * pAddr )
26722672
((struct sockaddr_in *)pAddr)->sin_addr.s_addr = htonl( INADDR_LOOPBACK );
26732673
else
26742674
{
2675+
#ifdef HAVE_INET_PTON
2676+
if (!inet_pton(AF_INET, p, &((struct sockaddr_in *)pAddr)->sin_addr))
2677+
#else
26752678
((struct sockaddr_in *)pAddr)->sin_addr.s_addr = inet_addr( p );
26762679
if ( ((struct sockaddr_in *)pAddr)->sin_addr.s_addr == INADDR_BROADCAST)
2680+
#endif
26772681
{
26782682
doAddrInfo = 1;
26792683
}

0 commit comments

Comments
 (0)