]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_pjsip/pjsip_transport_management.c: Fix deadlock with transport keep alive.
authorRichard Mudgett <rmudgett@digium.com>
Tue, 3 Jul 2018 17:10:36 +0000 (12:10 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Tue, 3 Jul 2018 17:15:30 +0000 (12:15 -0500)
commitb34a7c54d495e01041e5a97c8b4328fd020f2557
tree25660d811ca1ef34b99bc0ec6d133ce1f33b6cf4
parente92c8203cb4db9b12ec76f7e5b6446dcab145653
res_pjsip/pjsip_transport_management.c: Fix deadlock with transport keep alive.

Using the keep_alive_interval option can result in a deadlock between the
pjproject transport manager group lock and the monitored transports ao2
container lock.  The pjproject transport manager group lock has to be
superior in the locking order to the monitored transports ao2 container
lock because of pjproject callbacks called when already holding the group
lock.  The lock inversion happens when Asterisk attempts to send a keep
alive packet over the reliable transports.

* Made keepalive_transport_thread() iterate over the monitored transports
container rather than use the ao2_callback() method.  This avoids holding
the container lock when sending the keep alive packet.

ASTERISK-26686

Change-Id: I5d5392a52e698bbe41a93f7d8e92bf0e61fe3951
res/res_pjsip/pjsip_transport_management.c