One question about getaddrinfo invoked in _dbus_listen_tcp_socket

Thiago Macieira thiago at kde.org
Mon Oct 3 19:38:36 UTC 2016


On segunda-feira, 3 de outubro de 2016 14:28:20 CEST Elvis Qin wrote:
> *What does you mean “No, it isn’t”. you mean current the A_ADDRCONFIG will
> pass to uclibc API * *getaddrinfo(host, port, &hints, &ai) with 0x0020 |
> 0x0001 ?*
> 
> >* *hints.ai_flags = AI_ADDRCONFIG | AI_PASSIVE;   ==== > actually if*
> >
> >* AL_ADDRCONFIG is not 0x0020 but 0, this ai_flags still is AI_PASSIVE.**
> >
> > No, it isn't.

It means you misread the code. It only passes 0 if AI_ADDRCONFIG wasn't 
defined. Since it is, then it passes the correct flag.

> *Last information for you reference, after changing this line to
> **hints.ai_flags
> = AI_PASSIVE  delete AI_ADDCONFIG, **It can fix my case successfully(mean
> launched dbus-deamon very early before network interface is created and
> assign IPv4 or IPv6 address.)*

You should fix your system so that the boot order works properly: don't start 
the daemon until the network is up and has obtained addresses.

> *So If you think that we can change this line to hints.ai_flags =
> AI_PASSIVE in this function in future release. In this way, the dbus-daemon
> can be used in X86/ARM/MIPS embedded network devices. *

We will not do that. First of all, because using TCP is not recommended. Using 
it on early boot is even worse. Instead, please fix your boot order.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center



More information about the dbus mailing list