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

getaddrinfo failed with -lbind and peter.marschall-011029.patch do not work

I am install openldap 2.20 in suse9+sp1(SUSE LINUX Enterprise Server 9 (i586) - Kernel 2.6.5-7.139-smp (1).)

make test failed,log show me "slap_get_listener_addresses: getaddrinfo ai_addr is NULL?"
<141 [lzjian] :/home/lzjian/src/openldap-2.2.20/tests>../servers/slapd/slapd -s0 -f ./testrun/slapd.1.conf -h l
dap://localhost:9011/ -d -1
@(#) $OpenLDAP: slapd 2.2.20 (Mar  7 2005 17:41:43) $
daemon_init: ldap://localhost:9011/
daemon_init: listen on ldap://localhost:9011/
daemon_init: 1 listeners to open...
slap_get_listener_addresses: getaddrinfo ai_addr is NULL?
slapd stopped.
connections_destroy: nothing to destroy.
<142 [lzjian] :/home/lzjian/src/openldap-2.2.20/tests>

then I search in openldap.org and found peter.marschall-011029.patch can fix this problem,
but patch failed:
<179 [lzjian] :/home/lzjian/src/openldap-2.2.20> patch -p0 < peter.marschall-011029.patch
patching file servers/slapd/daemon.c
Hunk #1 FAILED at 273.
Hunk #2 FAILED at 283.
2 out of 2 hunks FAILED -- saving rejects to file servers/slapd/daemon.c.rej

patch is provided in 2001,code change a lot.so I modify daemon.c by manual.but it didn't work.

I trace daemon.c with gdb,I found sai->ai_addr is null when host is not null,so the patch didn't work.

-   if( sai->ai_addr == NULL ) {
+   if( sai->ai_addr == NULL && host != NULL) {

My question£º
1¡¢Can anyone help me fix this problem?

2¡¢If I remove lib of bind,it can pass "make test".but will openldap work well?