From e6f7fe5a815ec919c4fd149d7eed50eab4a9eb06 Mon Sep 17 00:00:00 2001 From: kpfleming Date: Fri, 1 Sep 2006 17:35:06 +0000 Subject: put in proper fix for issue #7294 instead of the broken partial fix that was committed, and thereby also fix issue #7438 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@41716 f38db490-d61c-443f-a65b-d21fe96a405b --- rtp.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'rtp.c') diff --git a/rtp.c b/rtp.c index da759ff00..ee8e2c6c2 100644 --- a/rtp.c +++ b/rtp.c @@ -1041,11 +1041,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) -- cgit v1.2.3