Re: One question about getaddrinfo invoked in _dbus_listen_tcp_socket

Thiago Macieira <[email protected]>
Newsgroups gmane.comp.freedesktop.dbus
Message-ID <1807246.uG5DVLTEH2@tjmaciei-mobl1>
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

_______________________________________________
dbus mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dbus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.