Richard Mudgett aa514f420b 
	
	
	res_rtp_asterisk.c: Fix TURN deadlock by using ICE session group lock. ... 
			When a message is received on the TURN socket, the code processing the
message needs to call into the ICE/STUN session for further processing.
This code path locks the TURN group lock then the ICE/STUN group lock.  In
another thread an ICE/STUN timer can fire off to send a keep alive message
over the TURN socket.  In this code path, the ICE/STUN group lock is
obtained then the TURN group lock is obtained to send the packet.  A
classic deadlock case if the group locks are not the same.
* Made TURN get created using the ICE/STUN session's group lock.
NOTE: I was originally concerned that the ICE/STUN session can get
recreated by ice_reset_session() for an event like RTCP multiplexing
causing a change during SDP negotiation.  In this case the TURN group lock
would become different.  However, TURN is also recreated as part of the
ICE/STUN recreation in ice_create() when all known ICE candidates are
added to the new ICE session.  While the ICE/STUN and TURN sessions are
being recreated there is a period where the group locks could be
different.
ASTERISK-27023 #close
Patches:
    res_rtp_asterisk-turn-deadlock-fix.patch (license #6502 )
        patch uploaded by Michael Walton (modified)
Change-Id: Ic870edb99ce4988a8c8eb6e678ca7f19da1432b9 
		
	 
		2017-07-06 16:11:45 -05:00 
	 
	
	
	
		 
	
	
		
			
			
			
			
			
			2016-06-20 13:06:00 -04:00 
		 
	
		
			
			
			
			
			
			2017-01-24 10:48:41 -07:00 
		 
	
		
			
			
			
			
			
			2016-03-29 08:53:45 -05:00 
		 
	
		
			
			
			
			
			
			2017-07-05 16:08:18 -05:00 
		 
	
		
			
			
			
			
			
			2015-01-20 16:46:16 +00:00 
		 
	
		
			
			
			
			
			
			2017-05-26 12:06:34 -04:00 
		 
	
		
			
			
			
			
			
			2017-01-27 07:01:21 -06:00 
		 
	
		
			
			
			
			
			
			2017-05-30 17:07:56 -04:00 
		 
	
		
			
			
			
			
			
			2015-04-29 07:39:22 -04:00 
		 
	
		
			
			
			
			
			
			2017-03-27 10:36:23 -04:00 
		 
	
		
			
			
			
			
			
			2014-07-25 16:47:17 +00:00 
		 
	
		
			
			
			
			
			
			2014-07-25 16:47:17 +00:00 
		 
	
		
	
		
			
			
			
			
			
			2017-05-26 09:12:11 -05:00 
		 
	
		
	
		
			
			
			
			
			
			2017-06-15 18:31:53 -06:00 
		 
	
		
			
			
			
			
			
			2017-06-15 18:31:53 -06:00 
		 
	
		
			
			
			
			
			
			2017-06-15 18:31:53 -06:00 
		 
	
		
			
			
			
			
			
			2017-06-15 18:31:53 -06:00 
		 
	
		
			
			
			
			
			
			2017-06-15 18:31:53 -06:00 
		 
	
		
			
			
			
			
			
			2017-06-15 18:31:53 -06:00 
		 
	
		
			
			
			
			
			
			2017-06-15 18:31:53 -06:00 
		 
	
		
			
			
			
			
			
			2017-06-15 18:31:53 -06:00 
		 
	
		
			
			
			
			
			
			2017-04-12 16:46:22 -05:00 
		 
	
		
	
		
			
			
			
			
			
			2017-06-15 18:31:53 -06:00 
		 
	
		
			
			
			
			
			
			2017-06-15 18:31:53 -06:00 
		 
	
		
			
			
			
			
			
			2017-06-15 18:31:53 -06:00 
		 
	
		
			
			
			
			
			
			2017-04-12 16:46:22 -05:00 
		 
	
		
	
		
			
			
			
			
			
			2016-11-30 14:16:10 -05:00 
		 
	
		
			
			
			
			
			
			2014-10-12 07:44:32 +00:00 
		 
	
		
			
			
			
			
			
			2014-07-25 16:47:17 +00:00 
		 
	
		
			
			
			
			
			
			2014-07-25 16:47:17 +00:00 
		 
	
		
			
			
			
			
			
			2017-04-12 16:46:22 -05:00 
		 
	
		
	
		
			
			
			
			
			
			2017-04-12 16:46:22 -05:00 
		 
	
		
			
			
			
			
			
			2014-07-25 16:47:17 +00:00 
		 
	
		
			
			
			
			
			
			2017-02-10 18:01:54 -05:00 
		 
	
		
			
			
			
			
			
			2017-02-21 11:50:56 -05:00 
		 
	
		
			
			
			
			
			
			2017-02-22 17:37:34 -06:00 
		 
	
		
			
			
			
			
			
			2017-02-21 11:50:56 -05:00 
		 
	
		
			
			
			
			
			
			2017-03-01 08:23:55 -05:00 
		 
	
		
			
			
			
			
			
			2017-04-12 16:46:22 -05:00 
		 
	
		
			
			
			
			
			
			2017-04-12 16:46:22 -05:00 
		 
	
		
	
		
			
			
			
			
			
			2017-06-16 14:44:34 +02:00 
		 
	
		
			
			
			
			
			
			2016-01-09 13:39:00 -06:00 
		 
	
		
	
		
			
			
			
			
			
			2014-07-25 16:47:17 +00:00 
		 
	
		
			
			
			
			
			
			2017-04-12 16:46:22 -05:00 
		 
	
		
			
			
			
			
			
			2015-04-29 15:37:12 -05:00 
		 
	
		
			
			
			
			
			
			2016-10-13 18:11:37 -05:00 
		 
	
		
			
			
			
			
			
			2014-07-18 15:49:46 +00:00 
		 
	
		
			
			
			
			
			
			2014-07-25 16:47:17 +00:00 
		 
	
		
			
			
			
			
			
			2016-08-18 17:15:04 -05:00 
		 
	
		
			
			
			
			
			
			2017-05-23 11:57:18 -04:00 
		 
	
		
			
			
			
			
			
			2017-05-23 11:57:18 -04:00 
		 
	
		
			
			
			
			
			
			2016-12-08 11:46:30 +00:00 
		 
	
		
			
			
			
			
			
			2016-07-14 15:54:21 -05:00 
		 
	
		
			
			
			
			
			
			2016-06-23 10:03:01 -03:00 
		 
	
		
			
			
			
			
			
			2016-06-23 10:03:01 -03:00 
		 
	
		
			
			
			
			
			
			2015-12-04 08:57:50 -06:00 
		 
	
		
			
			
			
			
			
			2017-03-21 15:40:08 -04:00 
		 
	
		
			
			
			
			
			
			2017-05-18 17:35:21 -04:00 
		 
	
		
			
			
			
			
			
			2017-04-24 14:21:41 -04:00 
		 
	
		
			
			
			
			
			
			2016-06-08 12:26:29 -05:00 
		 
	
		
			
			
			
			
			
			2014-07-25 16:47:17 +00:00 
		 
	
		
			
			
			
			
			
			2017-04-12 16:46:22 -05:00 
		 
	
		
	
		
			
			
			
			
			
			2017-04-12 16:46:22 -05:00 
		 
	
		
			
			
			
			
			
			2015-01-09 17:54:49 +00:00 
		 
	
		
			
			
			
			
			
			2015-01-09 17:54:49 +00:00 
		 
	
		
			
			
			
			
			
			2015-04-13 07:27:40 -04:00 
		 
	
		
	
		
			
			
			
			
			
			2017-05-16 14:25:01 +00:00 
		 
	
		
	
		
			
			
			
			
			
			2015-05-21 18:18:16 -05:00 
		 
	
		
			
			
			
			
			
			2016-01-04 16:28:48 -07:00 
		 
	
		
	
		
			
			
			
			
			
			2016-08-21 18:54:26 -05:00 
		 
	
		
			
			
			
			
			
			2016-01-29 08:32:35 -06:00 
		 
	
		
			
			
			
			
			
			2016-09-21 11:05:34 -05:00 
		 
	
		
			
			
			
			
			
			2016-02-16 15:37:48 -07:00 
		 
	
		
			
			
			
			
			
			2016-03-29 08:53:45 -05:00 
		 
	
		
			
			
			
			
			
			2016-06-20 13:06:00 -04:00 
		 
	
		
			
			
			
			
			
			2014-10-09 17:45:23 +00:00 
		 
	
		
			
			
			
			
			
			2017-01-24 11:23:05 -06:00 
		 
	
		
			
			
			
			
			
			2016-01-20 06:13:41 -07:00 
		 
	
		
			
			
			
			
			
			2015-03-17 21:49:30 +00:00 
		 
	
		
			
			
			
			
			
			2017-02-20 22:20:54 -06:00 
		 
	
		
			
			
			
			
			
			2017-04-26 15:31:42 -05:00 
		 
	
		
			
			
			
			
			
			2017-03-28 15:44:07 -06:00 
		 
	
		
			
			
			
			
			
			2017-06-16 12:08:27 -04:00 
		 
	
		
			
			
			
			
			
			2016-12-31 18:56:09 -07:00 
		 
	
		
			
			
			
			
			
			2015-05-02 03:15:15 -04:00 
		 
	
		
			
			
			
			
			
			2016-05-19 09:06:30 -03:00 
		 
	
		
			
			
			
			
			
			2016-05-19 09:06:30 -03:00 
		 
	
		
			
			
			
			
			
			2016-04-27 10:58:25 -05:00 
		 
	
		
			
			
			
			
			
			2017-03-15 13:44:43 +00:00 
		 
	
		
			
			
			
			
			
			2016-09-09 17:09:54 -05:00 
		 
	
		
			
			
			
			
			
			2017-02-15 12:11:18 -07:00 
		 
	
		
	
		
			
			
			
			
			
			2016-05-27 12:42:40 -05:00 
		 
	
		
			
			
			
			
			
			2017-02-23 15:23:15 -07:00 
		 
	
		
			
			
			
			
			
			2014-10-16 14:35:00 +00:00 
		 
	
		
			
			
			
			
			
			2017-03-21 10:44:30 -04:00 
		 
	
		
			
			
			
			
			
			2016-05-30 18:27:35 -06:00 
		 
	
		
			
			
			
			
			
			2017-06-21 18:21:57 -05:00 
		 
	
		
			
			
			
			
			
			2017-04-12 16:46:22 -05:00 
		 
	
		
			
			
			
			
			
			2016-03-07 12:15:58 -07:00 
		 
	
		
			
			
			
			
			
			2017-04-12 16:46:22 -05:00 
		 
	
		
			
			
			
			
			
			2017-04-28 09:56:20 -06:00 
		 
	
		
			
			
			
			
			
			2017-04-12 16:46:22 -05:00 
		 
	
		
			
			
			
			
			
			2014-08-07 14:35:09 +00:00 
		 
	
		
			
			
			
			
			
			2017-04-12 16:46:22 -05:00 
		 
	
		
			
			
			
			
			
			2016-09-09 17:09:54 -05:00 
		 
	
		
			
			
			
			
			
			2015-04-09 22:35:11 +00:00 
		 
	
		
			
			
			
			
			
			2017-06-16 12:08:27 -04:00 
		 
	
		
			
			
			
			
			
			2015-08-06 07:03:28 -03:00 
		 
	
		
			
			
			
			
			
			2017-06-16 12:08:27 -04:00 
		 
	
		
			
			
			
			
			
			2017-04-07 13:38:14 +00:00 
		 
	
		
			
			
			
			
			
			2017-06-14 10:12:21 -06:00 
		 
	
		
			
			
			
			
			
			2016-03-30 12:17:29 -06:00 
		 
	
		
			
			
			
			
			
			2017-06-13 14:17:29 -05:00 
		 
	
		
			
			
			
			
			
			2016-11-10 14:23:46 -06:00 
		 
	
		
			
			
			
			
			
			2017-02-08 11:53:32 -06:00 
		 
	
		
			
			
			
			
			
			2015-11-13 15:31:02 -06:00 
		 
	
		
			
			
			
			
			
			2017-06-23 09:15:24 +02:00 
		 
	
		
			
			
			
			
			
			2017-04-12 16:46:22 -05:00 
		 
	
		
			
			
			
			
			
			2017-06-15 08:01:31 -05:00 
		 
	
		
			
			
			
			
			
			2017-06-13 14:17:29 -05:00 
		 
	
		
			
			
			
			
			
			2015-01-29 20:58:12 +00:00 
		 
	
		
			
			
			
			
			
			2017-06-27 17:46:43 +02:00 
		 
	
		
			
			
			
			
			
			2016-09-14 09:53:25 -05:00 
		 
	
		
			
			
			
			
			
			2017-06-14 09:54:16 -05:00 
		 
	
		
			
			
			
			
			
			2017-06-16 12:08:27 -04:00 
		 
	
		
			
			
			
			
			
			2017-06-29 14:44:43 -06:00 
		 
	
		
	
		
			
			
			
			
			
			2014-12-17 09:54:00 +00:00 
		 
	
		
	
		
	
		
			
			
			
			
			
			2017-07-06 16:11:45 -05:00 
		 
	
		
			
			
			
			
			
			2017-06-06 11:54:07 -04:00 
		 
	
		
			
			
			
			
			
			2016-06-10 17:24:00 -05:00 
		 
	
		
			
			
			
			
			
			2015-05-22 22:58:32 -04:00 
		 
	
		
			
			
			
			
			
			2017-04-12 16:46:22 -05:00 
		 
	
		
	
		
			
			
			
			
			
			2014-07-25 16:47:17 +00:00 
		 
	
		
			
			
			
			
			
			2016-05-19 19:47:21 -03:00 
		 
	
		
			
			
			
			
			
			2016-08-15 13:10:35 -05:00 
		 
	
		
			
			
			
			
			
			2017-02-13 10:57:16 -05:00 
		 
	
		
			
			
			
			
			
			2016-08-02 10:25:16 +00:00 
		 
	
		
			
			
			
			
			
			2016-07-07 10:02:45 -04:00 
		 
	
		
			
			
			
			
			
			2014-07-25 16:47:17 +00:00 
		 
	
		
	
		
			
			
			
			
			
			2017-05-26 12:06:34 -04:00 
		 
	
		
			
			
			
			
			
			2015-04-07 19:38:27 +00:00 
		 
	
		
			
			
			
			
			
			2014-08-22 16:44:21 +00:00 
		 
	
		
	
		
			
			
			
			
			
			2017-04-12 16:46:22 -05:00 
		 
	
		
	
		
			
			
			
			
			
			2014-07-25 16:47:17 +00:00 
		 
	
		
	
		
			
			
			
			
			
			2017-04-12 16:46:22 -05:00 
		 
	
		
	
		
			
			
			
			
			
			2017-04-12 16:46:22 -05:00 
		 
	
		
	
		
			
			
			
			
			
			2015-05-06 16:09:33 -05:00 
		 
	
		
	
		
			
			
			
			
			
			2017-04-12 16:46:22 -05:00 
		 
	
		
	
		
			
			
			
			
			
			2017-06-16 15:06:56 -05:00 
		 
	
		
	
		
			
			
			
			
			
			2017-04-12 16:46:22 -05:00 
		 
	
		
			
			
			
			
			
			2016-02-16 11:20:57 -07:00 
		 
	
		
			
			
			
			
			
			2017-04-14 17:50:56 -04:00 
		 
	
		
			
			
			
			
			
			2014-07-25 16:47:17 +00:00 
		 
	
		
			
			
			
			
			
			2015-07-02 12:10:22 +02:00 
		 
	
		
			
			
			
			
			
			2015-02-15 12:39:09 +00:00 
		 
	
		
			
			
			
			
			
			2015-07-02 12:10:22 +02:00 
		 
	
		
			
			
			
			
			
			2017-03-25 12:01:28 -04:00 
		 
	
		
	
		
			
			
			
			
			
			2016-09-25 13:40:35 -05:00