diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-09-01 17:35:06 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-09-01 17:35:06 +0000 |
commit | e6f7fe5a815ec919c4fd149d7eed50eab4a9eb06 (patch) | |
tree | 975008b66c899df5c6d761bfa5cb4bbf12a9dbd6 /rtp.c | |
parent | b7f2193c53c3cf035eaae1cf30f2c76644737c45 (diff) |
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
Diffstat (limited to 'rtp.c')
-rw-r--r-- | rtp.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -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) |