From: Brett Bryant Date: Mon, 21 Jul 2008 17:42:45 +0000 (+0000) Subject: Fix bug where ast_parse_arg would inadvertantly enable sip tcp when parsing a tcpbind... X-Git-Tag: 1.6.2.0-beta1~1631 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4ec0d5d762603fbe9a93e15f5bd621b7c82679e2;p=thirdparty%2Fasterisk.git Fix bug where ast_parse_arg would inadvertantly enable sip tcp when parsing a tcpbindaddr if it was disabled. (closes issue #13117) Reported by: pj git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@132468 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index afc9fa8cea..73de38733c 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -21007,8 +21007,10 @@ static int reload_config(enum channelreloadreason reason) sip_tcp_desc.sin.sin_family = ast_false(v->value) ? 0 : AF_INET; ast_debug(2, "Enabling TCP socket for listening\n"); } else if (!strcasecmp(v->name, "tcpbindaddr")) { + int family = sip_tcp_desc.sin.sin_family; if (ast_parse_arg(v->value, PARSE_INADDR, &sip_tcp_desc.sin)) ast_log(LOG_WARNING, "Invalid %s '%s' at line %d of %s\n", v->name, v->value, v->lineno, config); + sip_tcp_desc.sin.sin_family = family; ast_debug(2, "Setting TCP socket address to %s\n", v->value); } else if (!strcasecmp(v->name, "tlsenable")) { default_tls_cfg.enabled = ast_true(v->value) ? TRUE : FALSE;