mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-15 19:34:10 -05:00
Treat INADDR_LOOPBACK (as well as INADDR_ANY) as local host.
This commit is contained in:
parent
3b03b64b77
commit
2ae410bd1b
1 changed files with 11 additions and 0 deletions
|
|
@ -473,6 +473,17 @@ ldap_host_connected_to( Sockbuf *sb )
|
|||
{
|
||||
return LDAP_STRDUP( ldap_int_hostname );
|
||||
}
|
||||
|
||||
#ifdef INADDR_LOOPBACK
|
||||
localhost.sin_addr.s_addr = htonl( INADDR_LOOPBACK );
|
||||
|
||||
if( memcmp ( &localhost.sin_addr,
|
||||
&((struct sockaddr_in *)&sa)->sin_addr,
|
||||
sizeof(localhost.sin_addr) ) == 0 )
|
||||
{
|
||||
return LDAP_STRDUP( ldap_int_hostname );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue