One question about getaddrinfo invoked in _dbus_listen_tcp_socket

Thiago Macieira thiago at kde.org
Thu Sep 29 07:09:43 UTC 2016


On quinta-feira, 29 de setembro de 2016 14:11:47 PDT Elvis Qin wrote:
> Hello expert
> 
> This is Elvis from broadcom. Now I meet one problem about dbus-dameon which
> prefer adding more listen on TCP port,   it will meet below error “Failed
> to start message bus: Failed to lookup host/port: "*:123456": Name or
> service not known (-2)”

First of all, don't use TCP.

Second, please read up on the recent case of exploit on Jeep cars. Hint: it 
was caused by dbus-daemon used on TCP.

Third, 123456 is not a valid port number. That's probably why getaddrinfo is 
failing.

> After trace, I know it is for getaddreinfo error.  Would you explain why
> here we use below 2 flags and *AI_ADDRCONFIG = 0*?
> 
> *  hints.ai_flags = AI_ADDRCONFIG | AI_PASSIVE;   ==== > Why here we put
>  AI_ADDRCONFIG, any purpose? *

Yes, please read the documentation for AI_ADDRCONFIG. It's specified in 
RFC 3493, which reads:

   If the AI_ADDRCONFIG flag is specified, IPv4 addresses shall be
   returned only if an IPv4 address is configured on the local system,
   and IPv6 addresses shall be returned only if an IPv6 address is
   configured on the local system.  The loopback address is not
   considered for this case as valid as a configured address.

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



More information about the dbus mailing list