Module: sip-router Branch: master Commit: 443c6e55197c12e868e64fd87c29b03ecce2783d URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=443c6e55...
Author: Andrei Pelinescu-Onciul andrei@iptel.org Committer: Andrei Pelinescu-Onciul andrei@iptel.org Date: Thu May 28 20:53:56 2009 +0200
tls: minor fix: obey USE_IPV6
- if USE_IPV6 is not defined, don't try to parse/use ipv6 addresses.
Reported-by: Juha Heinanen jh@tutpro.com
---
modules/tls/tls_config.c | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/modules/tls/tls_config.c b/modules/tls/tls_config.c index ad40d85..5dbd4c5 100644 --- a/modules/tls/tls_config.c +++ b/modules/tls/tls_config.c @@ -46,7 +46,7 @@ static tls_cfg_t* cfg = NULL; static tls_domain_t* domain = NULL;
- +#ifdef USE_IPV6 static int parse_ipv6(struct ip_addr* ip, cfg_token_t* token, cfg_parser_t* st) { @@ -74,6 +74,7 @@ static int parse_ipv6(struct ip_addr* ip, cfg_token_t* token, st->file, token->start.line, token->start.col); return -1; } +#endif /* USE_IPV6 */
static int parse_ipv4(struct ip_addr* ip, cfg_token_t* token, @@ -196,7 +197,15 @@ static int parse_hostport(int* type, struct ip_addr* ip, unsigned int* port, }
if (t.type == '[') { +#ifdef USE_IPV6 if (parse_ipv6(ip, &t, st) < 0) return -1; +#else + ERR("%s:%d:%d: IPv6 address not supported (compiled without IPv6" + " support)\n", + st->file, t.start.line, t.start.col); + return -1; + } +#endif /* USE_IPV6 */ } else if (t.type == CFG_TOKEN_ALPHA) { opt = cfg_lookup_token(token_default, &t.val); if (opt) {