]> 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:40 +0000 (12:15 -0500)
commit0aff1a278e436f5881e423f8bcb3255f86292314
tree1dc3a6084560596cc00b56d1e6d9d383d6da9fe8
parenteb9c0311202c7a4b468725826331c3555d0acfb6
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