aboutsummaryrefslogtreecommitdiffstats
path: root/rtp.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-04-15 20:12:46 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-04-15 20:12:46 +0000
commite91382c468f737c287e46e0f15d3db278e8246ba (patch)
tree27b77fca0b77f50306b9884fc500a93427948e12 /rtp.c
parent93eac2ef38ab56d90204d42ab5e19b7f2fa02673 (diff)
Don't set the address with NAT mode if we haven't programmed an address
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2697 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'rtp.c')
-rwxr-xr-xrtp.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/rtp.c b/rtp.c
index 9e6395bb6..a6c630054 100755
--- a/rtp.c
+++ b/rtp.c
@@ -413,6 +413,12 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp)
ast_log(LOG_WARNING, "RTP Read too short\n");
return &null_frame;
}
+
+ /* Ignore if the other side hasn't been given an address
+ yet. */
+ if (!rtp->them.sin_addr.s_addr || !rtp->them.sin_port)
+ return &null_frame;
+
if (rtp->nat) {
/* Send to whoever sent to us */
if ((rtp->them.sin_addr.s_addr != sin.sin_addr.s_addr) ||
@@ -421,10 +427,6 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp)
ast_log(LOG_DEBUG, "RTP NAT: Using address %s:%d\n", inet_ntoa(rtp->them.sin_addr), ntohs(rtp->them.sin_port));
}
}
- /* Ignore if the other side hasn't been given an address
- yet. */
- if (!rtp->them.sin_addr.s_addr || !rtp->them.sin_port)
- return &null_frame;
/* Get fields */
seqno = ntohl(rtpheader[0]);