mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-04 12:12:48 +00:00
Fix a potential deadlock in socket_process. check_provisioning can eventually
call find_callno. You can't hold a pvt lock while calling find_callno because it goes through and locks every single one looking for a match. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79214 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -6981,8 +6981,15 @@ retryowner:
|
|||||||
/* Ignore if it's already up */
|
/* Ignore if it's already up */
|
||||||
if (ast_test_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED | IAX_STATE_TBD))
|
if (ast_test_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED | IAX_STATE_TBD))
|
||||||
break;
|
break;
|
||||||
if (ies.provverpres && ies.serviceident && sin.sin_addr.s_addr)
|
if (ies.provverpres && ies.serviceident && sin.sin_addr.s_addr) {
|
||||||
|
ast_mutex_unlock(&iaxsl[fr->callno]);
|
||||||
check_provisioning(&sin, fd, ies.serviceident, ies.provver);
|
check_provisioning(&sin, fd, ies.serviceident, ies.provver);
|
||||||
|
ast_mutex_lock(&iaxsl[fr->callno]);
|
||||||
|
if (!iaxs[fr->callno]) {
|
||||||
|
ast_mutex_unlock(&iaxsl[fr->callno]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
/* If we're in trunk mode, do it now, and update the trunk number in our frame before continuing */
|
/* If we're in trunk mode, do it now, and update the trunk number in our frame before continuing */
|
||||||
if (ast_test_flag(iaxs[fr->callno], IAX_TRUNK)) {
|
if (ast_test_flag(iaxs[fr->callno], IAX_TRUNK)) {
|
||||||
int new_callno;
|
int new_callno;
|
||||||
@@ -7583,8 +7590,15 @@ retryowner2:
|
|||||||
memset(&sin, 0, sizeof(sin));
|
memset(&sin, 0, sizeof(sin));
|
||||||
if (update_registry(iaxs[fr->callno]->peer, &sin, fr->callno, ies.devicetype, fd, ies.refresh))
|
if (update_registry(iaxs[fr->callno]->peer, &sin, fr->callno, ies.devicetype, fd, ies.refresh))
|
||||||
ast_log(LOG_WARNING, "Registry error\n");
|
ast_log(LOG_WARNING, "Registry error\n");
|
||||||
if (ies.provverpres && ies.serviceident && sin.sin_addr.s_addr)
|
if (ies.provverpres && ies.serviceident && sin.sin_addr.s_addr) {
|
||||||
|
ast_mutex_unlock(&iaxsl[fr->callno]);
|
||||||
check_provisioning(&sin, fd, ies.serviceident, ies.provver);
|
check_provisioning(&sin, fd, ies.serviceident, ies.provver);
|
||||||
|
ast_mutex_lock(&iaxsl[fr->callno]);
|
||||||
|
if (!iaxs[fr->callno]) {
|
||||||
|
ast_mutex_unlock(&iaxsl[fr->callno]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
registry_authrequest(iaxs[fr->callno]->peer, fr->callno);
|
registry_authrequest(iaxs[fr->callno]->peer, fr->callno);
|
||||||
|
Reference in New Issue
Block a user