From 47dc024f7eb268dca65949d68914aa29b2840711 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sat, 16 Oct 2004 21:53:30 +0000 Subject: Change interface of parse_addr_port() to return address in host order, since most users seem to want that. svn:r2542 --- src/common/util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/common/util.c') 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) * address is provided, set *address to a copy of the * host portion of the string. If addr is provided, try to * resolve the host portion of the string and store it into - * *addr (in network byte order). If port is provided, + * *addr (in host byte order). If port is provided, * store the port number into *port, 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) { -- cgit v1.2.3