aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-11-21 13:17:32 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-11-21 13:17:32 +0000
commit4e22fe6e83e689517fe21bf73a1e65586f48fcc7 (patch)
treecf10983fae417c92e0b5a426750bf811ae2c16aa /channels
parent504469ada1fa40b2841265fb98196c78ff739be5 (diff)
issue #5815
git-svn-id: http://svn.digium.com/svn/asterisk/branches/v1-2@7167 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rwxr-xr-xchannels/chan_iax2.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index c051330a6..0c4a8b958 100755
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -859,10 +859,11 @@ static int iax2_getpeername(struct sockaddr_in sin, char *host, int len, int loc
{
struct iax2_peer *peer;
int res = 0;
+
if (lockpeer)
ast_mutex_lock(&peerl.lock);
peer = peerl.peers;
- while(peer) {
+ while (peer) {
if ((peer->addr.sin_addr.s_addr == sin.sin_addr.s_addr) &&
(peer->addr.sin_port == sin.sin_port)) {
ast_copy_string(host, peer->name, len);
@@ -879,8 +880,10 @@ static int iax2_getpeername(struct sockaddr_in sin, char *host, int len, int loc
ast_copy_string(host, peer->name, len);
if (ast_test_flag(peer, IAX_TEMPONLY))
destroy_peer(peer);
+ res = 1;
}
}
+
return res;
}