Re: Connecting to Sun DS 5.2 and 6.1 using IPv6 address

venu <[email protected]>
Newsgroups gmane.comp.mozilla.devel.directory
Organization http://groups.google.com
Message-ID <975f378a-d058-4bf0-9e43-308589899e2f@m73g2000hsh.googlegroups.com>
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");
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.