aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-10-16 21:53:30 +0000
committerNick Mathewson <nickm@torproject.org>2004-10-16 21:53:30 +0000
commit47dc024f7eb268dca65949d68914aa29b2840711 (patch)
treef22f9795384bff92c731d95872804bc416abca82 /src/common/util.c
parent8300c4ae6a0d55c40d94613b5e22cb25b5723bd1 (diff)
downloadtor-47dc024f7eb268dca65949d68914aa29b2840711.tar
tor-47dc024f7eb268dca65949d68914aa29b2840711.tar.gz
Change interface of parse_addr_port() to return address in host order, since most users seem to want that.
svn:r2542
Diffstat (limited to 'src/common/util.c')
-rw-r--r--src/common/util.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common/util.c b/src/common/util.c
index 244eb11b4..39c7311e6 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -2066,7 +2066,7 @@ int tor_lookup_hostname(const char *name, uint32_t *addr)
* <b>address</b> is provided, set *<b>address</b> to a copy of the
* host portion of the string. If <b>addr</b> is provided, try to
* resolve the host portion of the string and store it into
- * *<b>addr</b> (in network byte order). If <b>port</b> is provided,
+ * *<b>addr</b> (in host byte order). If <b>port</b> is provided,
* store the port number into *<b>port</b>, or 0 if no port is given.
* Return 0 on success, -1 on failure.
*/
@@ -2102,6 +2102,7 @@ parse_addr_port(const char *addrport, char **address, uint32_t *addr,
ok = 0;
*addr = 0;
}
+ *addr = ntohl(*addr);
}
if (address && ok) {