Full_Name: Peter Marschall Version: 20.0.18 OS: Linux 2.4.x URL: ftp://ftp.openldap.org/incoming/peter.marschall-011029.patch Submission from: (NULL) (194.145.150.12) The man page for getaddrinfo() in the GNU C library states: If node is NULL, the network address in each socket struc- ture is initialized according to the AI_PASSIVE flag, which is set in the ai_flags member of the hints parame- ter. The network address in each socket structure will be left unspecified if AI_PASSIVE flag is set. This is used by server applications, which intend to accept client con- nections on any network address. The network address will be set to the loopback interface address if the AI_PASSIVE flag is not set. This is used by client applications, which intend to connect to a server running on the same network host. So, at least for glibc, the ai_addr field of the addrinfo structure may be legally NULL when the AI_PASSIVE flag is set and host is NULL. Unfortunately slap_get_listener_addresses() in servers/slapd/daemon.c issues a warnung when ai_addr is NULL no matter what which value host has. The patch in ftp://ftp.openldap.org/incoming/ should fix this problem. Since my knowledge in network programming is somewhat limited, this patch may need some polishing.
On Mon, Oct 29, 2001 at 01:55:20PM +0000, peter.marschall@mayn.de wrote: > Full_Name: Peter Marschall > Version: 20.0.18 > OS: Linux 2.4.x > URL: ftp://ftp.openldap.org/incoming/peter.marschall-011029.patch > Submission from: (NULL) (194.145.150.12) > > > The man page for getaddrinfo() in the GNU C library states: > If node is NULL, the network address in each socket struc- > ture is initialized according to the AI_PASSIVE flag, > which is set in the ai_flags member of the hints parame- > ter. The network address in each socket structure will be > left unspecified if AI_PASSIVE flag is set. This is used > by server applications, which intend to accept client con- > nections on any network address. The network address will > be set to the loopback interface address if the AI_PASSIVE > flag is not set. This is used by client applications, > which intend to connect to a server running on the same > network host. > So, at least for glibc, the ai_addr field of the addrinfo structure > may be legally NULL when the AI_PASSIVE flag is set and host is NULL. I believe this is just poor language. The draft specs state that if AI_PASSIVE is set, the address will be set to INADDR_ANY for IPv4 and IN6ADDR_ANY_INIT for IPv6. I think this is what is meant by unspecified above. Have you found getaddrinfo() implementations that return just a NULL pointer? If so, which? The GNU C library code I have seen, seems not to return a NULL pointer, but I might have missed something. Stig
At 01:39 PM 2001-10-30, Stig@OpenLDAP.org wrote: >On Mon, Oct 29, 2001 at 01:55:20PM +0000, peter.marschall@mayn.de wrote: >> Full_Name: Peter Marschall >> Version: 20.0.18 >> OS: Linux 2.4.x >> URL: ftp://ftp.openldap.org/incoming/peter.marschall-011029.patch >> Submission from: (NULL) (194.145.150.12) >> >> >> The man page for getaddrinfo() in the GNU C library states: >> If node is NULL, the network address in each socket struc- >> ture is initialized according to the AI_PASSIVE flag, >> which is set in the ai_flags member of the hints parame- >> ter. The network address in each socket structure will be >> left unspecified if AI_PASSIVE flag is set. This is used >> by server applications, which intend to accept client con- >> nections on any network address. The network address will >> be set to the loopback interface address if the AI_PASSIVE >> flag is not set. This is used by client applications, >> which intend to connect to a server running on the same >> network host. >> So, at least for glibc, the ai_addr field of the addrinfo structure >> may be legally NULL when the AI_PASSIVE flag is set and host is NULL. > >I believe this is just poor language. The draft s/draft/RFC 2553/ >specs state that if >AI_PASSIVE is set, the address will be set to INADDR_ANY for IPv4 and >IN6ADDR_ANY_INIT for IPv6. I think this is what is meant by unspecified >above. Have you found getaddrinfo() implementations that return just a >NULL pointer? If so, which? The GNU C library code I have seen, seems >not to return a NULL pointer, but I might have missed something.
On Tue, Oct 30, 2001 at 11:03:49PM +0000, Kurt@OpenLDAP.org wrote: > At 01:39 PM 2001-10-30, Stig@OpenLDAP.org wrote: > >I believe this is just poor language. The draft > > s/draft/RFC 2553/ It also says the same in the 2553bis draft, and in the Open Group base specification draft. RFC 2553 is a bit out-dated, but they say the same on this matter. Stig
changed notes
changed notes changed state Open to Suspended
changed notes changed state Suspended to Closed
moved from Incoming to Archive.Incoming
broken getaddrinfo impl