One question about getaddrinfo invoked in _dbus_listen_tcp_socket

Elvis Qin elvis.qin at broadcom.com
Thu Sep 29 06:11:47 UTC 2016


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)”



After trace, I know it is for getaddreinfo error.  Would you explain why
here we use below 2 flags and *AI_ADDRCONFIG = 0*?



Really look forward to your response.



dbus/dbus-sysdeps-unix.c



*  hints.ai_flags = AI_ADDRCONFIG | AI_PASSIVE;   ==== > Why here we put
 AI_ADDRCONFIG, any purpose? *

     if ((res = getaddrinfo(host, port, &hints, &ai)) != 0 || !ai)

    {

      dbus_set_error (error,

                      _dbus_error_from_errno (errno),

                      "Failed to lookup host/port: \"%s:%s\": %s (%d)",

                      host ? host : "*", port, gai_strerror(res), res);

      goto failed;

}



Thanks

Elvis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/dbus/attachments/20160929/1f1fdee4/attachment.html>


More information about the dbus mailing list