aboutsummaryrefslogtreecommitdiffstats
path: root/rtp.c
diff options
context:
space:
mode:
authorroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-09-01 18:02:51 +0000
committerroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-09-01 18:02:51 +0000
commit7f8eb5f74d6aaa9413f1c90c9374d202eba1ea8f (patch)
treee7cee630ae90c5699958925aa124054b93bf2341 /rtp.c
parentd9585becbd04a9bb1944a4efd305558f6e828752 (diff)
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@41734 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'rtp.c')
-rw-r--r--rtp.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/rtp.c b/rtp.c
index 7de9727e9..376bd93ce 100644
--- a/rtp.c
+++ b/rtp.c
@@ -1045,11 +1045,17 @@ void ast_rtp_set_peer(struct ast_rtp *rtp, struct sockaddr_in *them)
rtp->rxseqno = 0;
}
-void ast_rtp_get_peer(struct ast_rtp *rtp, struct sockaddr_in *them)
+int ast_rtp_get_peer(struct ast_rtp *rtp, struct sockaddr_in *them)
{
- them->sin_family = AF_INET;
- them->sin_port = rtp->them.sin_port;
- them->sin_addr = rtp->them.sin_addr;
+ if ((them->sin_family != AF_INET) ||
+ (them->sin_port != rtp->them.sin_port) ||
+ (them->sin_addr.s_addr != rtp->them.sin_addr.s_addr)) {
+ them->sin_family = AF_INET;
+ them->sin_port = rtp->them.sin_port;
+ them->sin_addr = rtp->them.sin_addr;
+ return 1;
+ }
+ return 0;
}
void ast_rtp_get_us(struct ast_rtp *rtp, struct sockaddr_in *us)