On Jul 7, 11:53 am, Anton Bobrov <[EMAIL PROTECTED]> wrote:
> use prldap_init() instead of simple ldap_init(). prldap_init
> will install NSPR layer which has builtin support for IPv6.
>
>
>
> venu wrote:
> > Hi,
> > I am using Mozilla LDAP SDK 6.0.4 libraries to connect to a directory
> > server. While the code works fine for IPv4 addresses, it fails with
> > IPv6 address.
> > I have the DS (5.2 and 6.1) installed on my system (Windows XP). The C
> > code snippet is given below:
>
> > ...
> > if ((ld = ldap_init(argv[1], ldap_port)) == NULL) {
> > printf("Error initializing\n");
> > exit(1);
> > }
>
> > if ((r = ldap_simple_bind_s(ld, "cn=directory manager", "admin1234")) !
> > = LDAP_SUCCESS) {
> > printf("Error binding %s\n", ldap_err2string(r));
> > exit(1);
> > }
> > ...
>
> > If I pass an IPv4 address to ldap_init(), everything works fine. But
> > if i use the IPv6 loopback address (::1), ldap_simple_bind_s() fails
> > with the following error:
>
> > Error binding Can't connect to the LDAP server
>
> > I am able to ping successfully to ::1.
>
> > Could anyone please help me resolve this issue?
> > _______________________________________________
> > dev-tech-ldap mailing list
> > [EMAIL PROTECTED]
> >https://lists.mozilla.org/listinfo/dev-tech-ldap- Hide quoted text -
>
> - Show quoted text -

Thanks for the reply, Anton. i have used prldap_init() as well but
then it doesnt connect even with ipv4 address.
Is this the correct way to use prldap_init():

prldap_init(argv[1], ldap_port, 0);
ldap_simple_bind_s(ld, "cn=directory manager", "admin1234");

_______________________________________________
dev-tech-ldap mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-ldap

Reply via email to