From: Russell Bryant Date: Wed, 26 Dec 2007 16:51:16 +0000 (+0000) Subject: Fix a bug in peer handling that caused multiple instances of a peer to end up X-Git-Tag: 1.6.0-beta1~3^2~303 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21e057e79df0fc8263f838d318f922af519a8e96;p=thirdparty%2Fasterisk.git Fix a bug in peer handling that caused multiple instances of a peer to end up in the peers container after a reload. Somehow, this bug doesn't exist in 1.4 ... (closes issue #11626) (reported by pnlarsson, additional info from mvanbaak, fixed by me) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@94788 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index b424c608de..3aebc4f702 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -6454,7 +6454,7 @@ static void unlink_peer(struct iax2_peer *peer) } } - unlink_peer(peer); + ao2_unlink(peers, peer); } static void __expire_registry(const void *data) @@ -9872,6 +9872,7 @@ static struct iax2_peer *build_peer(const char *name, struct ast_variable *v, st oldha = peer->ha; peer->ha = NULL; } + unlink_peer(peer); } else if ((peer = ao2_alloc(sizeof(*peer), peer_destructor))) { peer->expire = -1; peer->pokeexpire = -1;