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
This commit is contained in:
Russell Bryant
2007-12-26 16:51:16 +00:00
parent 3c5b0443ef
commit 21e057e79d

View File

@@ -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;