]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fixing possible bug in auth of BYE
authorOlle Johansson <oej@edvina.net>
Wed, 16 May 2007 10:55:16 +0000 (10:55 +0000)
committerOlle Johansson <oej@edvina.net>
Wed, 16 May 2007 10:55:16 +0000 (10:55 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@64603 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 92b49c27dbb4322bd02313ff3071c9145d390877..81a5c68913be24acac66405d59e90b746a879d5d 100644 (file)
@@ -10177,10 +10177,11 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_
                        if (sipmethod == SIP_INVITE) {
                                handle_response_invite(p, resp, rest, req, ignore, seqno);
                        } else if (sipmethod == SIP_BYE || sipmethod == SIP_REFER) {
-                               if (ast_strlen_zero(p->authname))
+                               if (ast_strlen_zero(p->authname)) {
                                        ast_log(LOG_WARNING, "Asked to authenticate %s, to %s:%d but we have no matching peer!\n",
                                                        msg, ast_inet_ntoa(iabuf, sizeof(iabuf), p->recv.sin_addr), ntohs(p->recv.sin_port));
                                        ast_set_flag(p, SIP_NEEDDESTROY);       
+                               }
                                if ((p->authtries == MAX_AUTHTRIES) || do_proxy_auth(p, req, "Proxy-Authenticate", "Proxy-Authorization", sipmethod, 0)) {
                                        ast_log(LOG_NOTICE, "Failed to authenticate on %s to '%s'\n", msg, get_header(&p->initreq, "From"));
                                        ast_set_flag(p, SIP_NEEDDESTROY);