diff options
author | Nick Mathewson <nickm@torproject.org> | 2009-01-21 07:24:50 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2009-01-21 07:24:50 +0000 |
commit | bf2b71beb86804acc16f98b8a10ffbb9544ff758 (patch) | |
tree | 8ba0cd6163c2de7e36f3d64263d2bf002fc08690 /src/common/address.c | |
parent | 3f8ab367c1c7f6822376e357f3437fdec21ce257 (diff) | |
download | tor-bf2b71beb86804acc16f98b8a10ffbb9544ff758.tar.gz tor-bf2b71beb86804acc16f98b8a10ffbb9544ff758.zip |
Fix an error in tor_addr_parse that kept us from having a hidden service or a bridge live at an IPv6 address.
svn:r18206
Diffstat (limited to 'src/common/address.c')
-rw-r--r-- | src/common/address.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/address.c b/src/common/address.c index 0e92b71f91..59412363ab 100644 --- a/src/common/address.c +++ b/src/common/address.c @@ -962,9 +962,9 @@ tor_addr_from_str(tor_addr_t *addr, const char *src) return result; } -/** Parse an address or address-port combination from <b>s</b>, and put the - result in <b>addr_out</b> and (optionally) <b>port_out</b>. Return 0 on - success, negative on failure. */ +/** Parse an address or address-port combination from <b>s</b>, resolve the + * address as needed, and put the result in <b>addr_out</b> and (optionally) + * <b>port_out</b>. Return 0 on success, negative on failure. */ int tor_addr_port_parse(const char *s, tor_addr_t *addr_out, uint16_t *port_out) { @@ -982,7 +982,7 @@ tor_addr_port_parse(const char *s, tor_addr_t *addr_out, uint16_t *port_out) port = strstr(s, "]"); if (!port) goto err; - tmp = tor_strndup(s+1, port-s); + tmp = tor_strndup(s+1, port-(s+1)); port = port+1; if (*port == ':') port++; |