]> git.sur5r.net Git - openldap/commitdiff
Treat INADDR_LOOPBACK (as well as INADDR_ANY) as local host.
authorKurt Zeilenga <kurt@openldap.org>
Tue, 15 Aug 2000 02:13:00 +0000 (02:13 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 15 Aug 2000 02:13:00 +0000 (02:13 +0000)
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;