]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/os-ip.c
Import latest changes from devel
[openldap] / libraries / libldap / os-ip.c
index c2143561a10a7e2841b931901ecd5dddccb9a50e..cf7f322e76b83a5418ffe5a21b8115ed6328fcc0 100644 (file)
@@ -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;