diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2015-02-04 13:15:20 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2015-02-04 15:19:42 +0000 |
commit | d70675e940ab6295e6032e8e7b6362083c35745a (patch) | |
tree | f5eb1211ef058516c43d5a3d0fb028bffd824c4d | |
parent | ffa69bcb55aa49d62a21c6ee64f45c779ff11750 (diff) | |
download | dbus-d70675e940ab6295e6032e8e7b6362083c35745a.tar.gz |
_dbus_listen_tcp_socket: use NI_NUMERICSERV to determine port number
If we happen to have been given (say) port 30865, we want to
represent that as host=localhost,port=30865 and not
host=localhost,port=csync2.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=87999
-rw-r--r-- | dbus/dbus-sysdeps-unix.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c index f4a42d89..f6ec8abc 100644 --- a/dbus/dbus-sysdeps-unix.c +++ b/dbus/dbus-sysdeps-unix.c @@ -1518,7 +1518,7 @@ _dbus_listen_tcp_socket (const char *host, if (result == -1 || (res = getnameinfo ((struct sockaddr*)&addr, addrlen, NULL, 0, portbuf, sizeof(portbuf), - NI_NUMERICHOST)) != 0) + NI_NUMERICHOST | NI_NUMERICSERV)) != 0) { dbus_set_error (error, _dbus_error_from_errno (errno), "Failed to resolve port \"%s:%s\": %s (%s)", |