diff options
author | George Kadianakis <desnacked@riseup.net> | 2012-11-28 00:24:58 +0200 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-11-27 22:18:08 -0500 |
commit | 6f21d2e49657ada264cace9da7cf6945b4fc073d (patch) | |
tree | b31176e1421128aa2b5a270abb8ff9e4a560e4cc /src/or | |
parent | f88c3038697b00f50b2da12f46fc76ee0e20d646 (diff) | |
download | tor-6f21d2e49657ada264cace9da7cf6945b4fc073d.tar.gz tor-6f21d2e49657ada264cace9da7cf6945b4fc073d.zip |
Introduce tor_addr_port_parse() and use it to parse ServerTransportListenAddr.
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/config.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/or/config.c b/src/or/config.c index 822bc629bc..48e33b9c80 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -4152,7 +4152,7 @@ get_bindaddr_from_transport_listen_line(const char *line,const char *transport) smartlist_t *items = NULL; const char *parsed_transport = NULL; char *addrport = NULL; - char *addr = NULL; + tor_addr_t addr; uint16_t port = 0; items = smartlist_new(); @@ -4172,18 +4172,12 @@ get_bindaddr_from_transport_listen_line(const char *line,const char *transport) goto err; /* Validate addrport */ - if (tor_addr_port_split(LOG_WARN, addrport, &addr, &port)<0) { + if (tor_addr_port_parse(LOG_WARN, addrport, &addr, &port)<0) { log_warn(LD_CONFIG, "Error parsing ServerTransportListenAddr " "address '%s'", addrport); goto err; } - if (!port) { - log_warn(LD_CONFIG, - "ServerTransportListenAddr address '%s' has no port.", addrport); - goto err; - } - goto done; err: @@ -4193,7 +4187,6 @@ get_bindaddr_from_transport_listen_line(const char *line,const char *transport) done: SMARTLIST_FOREACH(items, char*, s, tor_free(s)); smartlist_free(items); - tor_free(addr); return addrport; } |