Skip to content

get rid of inet_addr usage #6948

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions main/fastcgi.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,8 +688,12 @@ int fcgi_listen(const char *path, int backlog)
if (!*host || !strncmp(host, "*", sizeof("*")-1)) {
sa.sa_inet.sin_addr.s_addr = htonl(INADDR_ANY);
} else {
#ifdef HAVE_INET_PTON
if (!inet_pton(AF_INET, host, &sa.sa_inet.sin_addr)) {
#else
sa.sa_inet.sin_addr.s_addr = inet_addr(host);
if (sa.sa_inet.sin_addr.s_addr == INADDR_NONE) {
#endif
struct hostent *hep;

if(strlen(host) > MAXFQDNLEN) {
Expand Down
4 changes: 4 additions & 0 deletions sapi/litespeed/lsapilib.c
Original file line number Diff line number Diff line change
Expand Up @@ -2672,8 +2672,12 @@ int LSAPI_ParseSockAddr( const char * pBind, struct sockaddr * pAddr )
((struct sockaddr_in *)pAddr)->sin_addr.s_addr = htonl( INADDR_LOOPBACK );
else
{
#ifdef HAVE_INET_PTON
if (!inet_pton(AF_INET, p, &((struct sockaddr_in *)pAddr)->sin_addr))
#else
((struct sockaddr_in *)pAddr)->sin_addr.s_addr = inet_addr( p );
if ( ((struct sockaddr_in *)pAddr)->sin_addr.s_addr == INADDR_BROADCAST)
#endif
{
doAddrInfo = 1;
}
Expand Down