mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
Treat INADDR_LOOPBACK (as well as INADDR_ANY) as local host.
This commit is contained in:
parent
3b03b64b77
commit
2ae410bd1b
@ -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 New Issue
Block a user