Merged revisions 319202 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r319202 | twilson | 2011-05-16 11:00:21 -0700 (Mon, 16 May 2011) | 4 lines
  
  Unlink a peer from peers_by_ip when expiring a registration
  
  Review: https://reviewboard.asterisk.org/r/1218/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@319204 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Terry Wilson
2011-05-16 18:17:43 +00:00
parent 215638e661
commit ac0cc37ab5

View File

@@ -13135,6 +13135,11 @@ static int expire_register(const void *data)
if (peer->selfdestruct ||
ast_test_flag(&peer->flags[1], SIP_PAGE2_RTAUTOCLEAR)) {
unlink_peer_from_tables(peer);
} else if (!ast_sockaddr_isnull(&peer->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