mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-03 11:11:05 +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 */
|
||||
if (ast_test_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED | IAX_STATE_TBD))
|
||||
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);
|
||||
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 (ast_test_flag(iaxs[fr->callno], IAX_TRUNK)) {
|
||||
int new_callno;
|
||||
@@ -7583,8 +7590,15 @@ retryowner2:
|
||||
memset(&sin, 0, sizeof(sin));
|
||||
if (update_registry(iaxs[fr->callno]->peer, &sin, fr->callno, ies.devicetype, fd, ies.refresh))
|
||||
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);
|
||||
ast_mutex_lock(&iaxsl[fr->callno]);
|
||||
if (!iaxs[fr->callno]) {
|
||||
ast_mutex_unlock(&iaxsl[fr->callno]);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
registry_authrequest(iaxs[fr->callno]->peer, fr->callno);
|
||||
|
Reference in New Issue
Block a user