[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: (ITS#3704) slapd: socket problem using gcc elf-64
vbrindus@adexa.com wrote:
> I have the same issue on HPUX 11.00. Compiler is cc, building openldap
> 2.2.24, 64 bits (+DA2.0W switch).
>
> I can confirm that line 1545 in daemon.c:
> s = accept( slap_listeners[l]->sl_sd, (struct sockaddr *) &from, &len );
> returns a valid s but does not fill the "from" structure, and subsequently
> switch ( from.sa_addr.sa_family ) at line 1667 closes the connection.
>
> Exactly the same sources compile and work ok on SunOS 2.8 64 bits.
>
> After fighting with this issue for some time, I noticed in the manpage at
> http://docs.hp.com/en/B2355-90682/accept.2.html that, by default, "accept"
> on HP-UX uses different parameters than Solaris :-(. So the thing to do is
> to add -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1 to CFLAGS (I also added
> it to CPPFLAGS, although I don't know if it's mandatory), and also add
> -lxnet to LDFLAGS. You can find more details at
> http://devrsrc1.external.hp.com/STKS/impacts/i107.html
>
Thanks for the information. Apparently the trouble is that on the 64 bit
compile, sizeof(int) < sizeof(socklen_t). Since daemon.c uses socklen_t
and the default HPUX implementation uses int, accept() sees a zero
passed for the addrlen. There are probably other reasons to use
-D_XOPEN_SOURCE hiding in there too.
>
> P.S. when compiling openldap on HP-UX 11.00 using native cc compiler (v
> 3.45) you could run into trouble because the usr/include/arpa/nameser.h file
> has a problem at line 94 (some nested comments). So better correct the file,
> if possible (you should need root acces for that...).
>
--
-- Howard Chu
Chief Architect, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc
OpenLDAP Core Team http://www.openldap.org/project/