[svn-commits] twilson: branch 1.6.2 r319202 - /branches/1.6.2/channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon May 16 13:00:26 CDT 2011


Author: twilson
Date: Mon May 16 13:00:21 2011
New Revision: 319202

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=319202
Log:
Unlink a peer from peers_by_ip when expiring a registration

Review: https://reviewboard.asterisk.org/r/1218/

Modified:
    branches/1.6.2/channels/chan_sip.c

Modified: branches/1.6.2/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/channels/chan_sip.c?view=diff&rev=319202&r1=319201&r2=319202
==============================================================================
--- branches/1.6.2/channels/chan_sip.c (original)
+++ branches/1.6.2/channels/chan_sip.c Mon May 16 13:00:21 2011
@@ -12605,6 +12605,11 @@
 	if (peer->selfdestruct ||
 	    ast_test_flag(&peer->flags[1], SIP_PAGE2_RTAUTOCLEAR)) {
 		unlink_peer_from_tables(peer);
+	} else if (peer->addr.sin_addr.s_addr) {
+		/* If we aren't self-destructing a temp_peer, we still need to unlink the peer
+		 * from the peers_by_ip table, otherwise we end up with multiple copies hanging
+		 * around each time a registration expires and the peer re-registers. */
+		ao2_t_unlink(peers_by_ip, peer, "ao2_unlink of peer from peers_by_ip table");
 	}
 
 	/* Only clear the addr after we check for destruction.  The addr must remain




More information about the svn-commits mailing list