[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#3704) slapd: socket problem using gcc elf-64



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
 
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...).
 
Best regards,
Vasile Brindus