]> 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)
committerKevin Harwell <kharwell@digium.com>
Mon, 27 Aug 2018 15:55:37 +0000 (10:55 -0500)
commit51616b277d9560b7a73deff841be088e670ef407
tree1e45cd72444f3a55bb41b2f3b2e77d8ff544dade
parent4958e6e16ede1ce64b5563588fe4c74c06ad618e
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